usually it's when projected need outpaces the available slots. for instance, if several people are projected to ETS or retire or a facility is expanding, they may need more of a certain specialty. since the lag time is 3 years it's an imperfect science and they're usually chasing their tail-- which is why no one can yell you year to year what the demand/available slots will be. ballpark, yes but that's going to be about it.
in general though yes, I do get the sense they to try to keep their "best" candidates in house. and USUHS must go military if available. sick spouse/family member I don't think they really care about and likely has little impact on the civilian deferment process.
--your friendly neighborhood tried to duck the AD military residency but got snagged anyway caveman