DOCTORSAIB is correct. The application gets you a spot to interview (if you get an interview, you have the required credentials) - programs are looking for interesting, trustworthy, hardworking residents. Once an interview is granted, however, the interview trumps all else. Some people are better at interviews than others naturally (lets be honest, some people are more pleasant and interesting you cannot fake interesting experiences. also there are a group of applicants that probably fake their way through interviews too). Again, programs are looking for interesting, trustworthy, hardworking residents. If your interview performance reinforces that you fit this description, your rank will be high. If there are any doubts or mismatches between application and interview performance - your rank will be low.
I am a firm believer that a handful of applicants get ranked highly by every program they interview at because their application is strong and they are interesting people who the interviewer would want to be around for 3 years. Some applicants try to "turn it on" at some interviews (the programs they actually want to go to). This is a dumb approach for obvious reasons you miss out at these programs and you may not match. Some applicants try to look cool in the eyes of other applicants (having a few too many cocktails at the dinners, acting bored during the interview breaks). This too is a dumb approach, but I have seen it done many times. Again, everyone is watching you.
Tips for interviewing - I am sure there are books on this, but most of this is obvious. You must know everything on your application backwards and forwards (ie Do not list some bogus research project if you cannot discuss it - you may interview with the world's expert on the topic. Do not list you have an interest in Mediterranean cooking unless you are ready to discuss how you like to prepare your favorite dish or where your favorite restaurant is...). Be humble but confident. Smile. Stay away from the applicants with bad attitudes. Try to portray that you have energy even if you dont. Be polite. State your connection with the program - have you lived in the city of the program before?
The above are generalizations for programs that want to turn out well-rounded clinicians and surgeons (most programs).