I have asked a lot of different residents/attendings in different competitive fields, notably ophtho, and they made many valid points as to why IMGs/FMGs are at a huge disadvantage for matching.
1. Visa status. It seems its costly and just a pain to have to deal with this for programs. Some programs won't even look at your application unless you are a US citizen and it makes sense. Sorting through applications/interviews/ranking etc is a pain as it is and international grads just throw another wrinkle in the process that most programs just don't want to deal with.
2. Step scores. There is a HUGE stigma with foreign grads and step scores. Many foreign medical schools, regardless of it is true, have gotten a reputation of just "teaching towards the boards". This, coupled with the fact that most IMGs/FMGs spend anywhere from 6 months to 1 year to study just for the step 1 makes the ridiculously high scores rather worthless as a gauge of "intelligence". The average US medical student spends anywhere from just a few days after second year to about a month studying for the test simply because US medical schools basically force you too with third year scheduling.
3. Communication skills/social understanding etc. A large part of being a good physician today is about being able to connect and communicate with faculty, colleagues, patients etc. It is just too risky for ophtho programs to make a mistake here because a residents, regardless of how smart they are, who has issues with this can be a huge detriment because residency classes are so small. I have personally witnessed how being less than stellar with English, not understanding how to deal with the many different personality types in the US, etc has caused issues with patient care and becomes a burden for coresidents and attendings.
I know everyone makes the decision to go to different medical schools for different reasons, but if you know for a fact you want to come to the US for residency, just try go to medical school here. It is difficult for a program chair or program director to gauge how prestigious or legitimate a lot of medical schools are around the world. Just too many. A HUGE issue is the increase of medical schools especially in the carribean, puerto rico, mexico, india etc. that, simply put, are built to make money and not make good physicians.
The few IMG/FMG ophtho residents I know matched because they came to the US and did 2+ years of an intensive research fellowship at stellar institions(Mass, Bascom, Columbia etc.) and got phenomenal letters out of it that spoke about everything from their intelligence to their people skills. You HAVE to get letters from HUGE names in ophthalmology. They can't just be "well-known". They pretty much have to be "Big-Wigs". You have a better chance of matching out of a native foreign country, than if you are a US citizen who went overseas. Going to another country to go to medical school is a "red flag" these days and rightfully so.