Lots of companies don't want to hire new grads, so there's a significant price premium for hiring someone with a couple years of experience. The companies that are willing to hire new grads aren't always willing to give annual raises that reflect that price premium. So lots of programmers with a couple of years of experience see that they can get a 20% raise by switching jobs. So they switch jobs.
(This happens with programmers later in their career too, but the difference between 8 and 10 years of experience is much less dramatic than the difference between 0 and 2. If a company gives the same annual raise to all its programmers in the same performance band regardless of experience, that raise may be too small for the newest ones, even if it's just right for the middle ones.)