um, im confused. Are you talking about the actual specialties (derm vs family practice) or the specific residencies (derm at mgh vs derm at minnesota)?
if the former, i imagine it's mostly lifestyle, money and prestige.
If the latter, it has to do with location (sunshine and beaches vs cold and rain), notoriety of the program, whether there's a particular guy everyone wants to work with (contributes to notoriety i guess, how many nights youre on call and what kind of call it is (how many patients you tend to get slammed with), certain preferable patient populations, reputation with fellowship programs, and reputation of being a nice, chill residency with nice people or a really malignant one.