I'm not a med student yet, so I cannot speak from personal experience; but from what I can gather, a school having an affiliated hospital makes it easier for their students to do rotations through the hospital. Audition rotations will dramatically increase your chances of getting into that residency program, so in that respect you will be favored. The more competitive specialties almost require that you do an audition rotation in order to be a serious candidate. Now hypothetically all things being equal (board scores, LORs, class rank) will a residency program pick the affiliated student over a student from a different program? I don't know the answer to that one. I would guess that there is some favoritism, but it should be minor.