I'm surprised nobody yet has mentioned reason no1 people switch jobs: to get a better-than-COL raise.
So I would say companies that continuously review compensation according to market and employee evolution would be better positioned to retain developers.