Haven't you ever watched Scrubs????
Residents are also known as housestaff. They're the docs in the the hospital and clinics 24/7.
Its nothing like shadowing.

Maybe the attending shadows you to make sure you dont kill anyone.
It's practicing their chosen field while under supervision - for long hours with an intense schedule. So, all settings for a given field are represented (wards, clinic, OR, etc.).
Residents are present at all of these settings to, in a way, have a first crack that the attending's patient (since they dont have their own). The resident comes up with an assessment and plan, discusses it with the attending, and carries it out. Or, their work is double-checked by the attending within a day or two.
Everything is hands on. The resident is the primary doctor for all patients, the attending is there to supervise and suggest. Every residency has a "skillset", or required procedures for that particular specialty. All procedures in the skillset must be completed in residency. And, this is rarely an issue, because if there is anything to be done, the resident will be the one to do it - oftentimes, the supervising attending isn't even in the hospital. Anything that happens in the hospital, an emergency, a newly admitted patient, daily rounds, anything, is done independently by the resident first, and then may be double-checked by the attending later.
The resident learns by intense experience. They also attend lectures and conferences. At the end of residency they sit for the Boards.