I go to a mid-lower MD program. Although we only match about 10-15 people into Family med there is a similar trend I saw happen when third year began.
When we all started and even throughout most of years 1/2, it was similar as how you described. 1-2 people genuinely wanted FM. Heck even under 10 wanted IM and most were considering gen surg as a backup to whatever crazy specialty they wanted.
1) step 1: the first and foremost reality bomb med students get. The average this last year was 229, so ~30% of the class (poor man statistics) got hit with scores that trashed their dreams. Some with 240+ kept chugging toward their specialty in mind and those in the middle 220-235 were left unsure since their score didn't completely make or break them. Then third year truly began.
2) third year grades: this may vary based on the school, but some people in that 220-235 range were now looking at new specialties they didn't really think about before: anesthesiology, radiology, internal med, and gen surg. They were told marvelous things like "oh don't worry. If you do well in third year and honor your rotations they may overlook that 220 for some surgery places." Mind you only about 10% get honors here and about 60% get "pass" and everyone in between got the high pass equivalent. This was the next big awakening with people who once wanted ortho but couldn't hit step 1, then got hit by the "pass" in surgery and perhaps in multiple other clerkships. It's a rough year for people hoping to show they can excel in their desired core clerkship most important for their field. Medicine especially was a rough reality bomb.
3. The worst of them all. The name brand: Then students with a 220 and straight passes are told they can still do a fellowship even if they squeak into a lower tier IM/gen surg fellowship and this is where the prestige lovers still see that glimmer of light. That's it! They can match into GI and make a ton of money or even breast surgery and be the hot shot in Hollywood, CA! what they fail to mention is the reality of top tier IM residency privilege. There needs to be a way to break into a prestigious IM program to get that GI fellowship in that desirable location and who gets those prestigious IM residencies? The guy with a 240 who honored their IM rotation if they are coming from a low tier MD school. Now wait, why is the average for matched IM 233? Because the NAME OF THE SCHOOL turned out to matter in the end. Feels like betrayal after SDN spewed crap about the name not mattering but in the prestige world, it mattered all along. Yup someone from UCLA school of medicine can match most prestigious IM programs with a 220 on step 1. The top name brands match at the top academic IM residencies to get the GI fellowship.
There's variability with the above but the same idea applies to the most insanely competitive fellowships out of gen surg as well.
After realizing #3 is true after sitting down and talking with an advisor you wish talked to you earlier, and for those who just would rather do outpatient than be a general internist, they turn to FM, psych, and the rest after calling it a day.
A lot of trickling going on with this algorithm but it's basically how you end up dispersing a group of 150-200 first year med students that start off wanting ortho and IR.