^This.
I've always had the philosophy that if you want to retain good employees, pay them more before they ask for more. If they have reached a point where they had to ask for more, they're probably going to leave soon.
I don't understand how do companies fail to realize this. Say an engineer leaves because you didn't get him that 20% pay bump. Even in the highest ranks of engineering, that's like what a 100k? 30k-40k on an average. Now imagine you go through the whole recruitment cycle. You have anywhere between 8-12 weeks of productivity loss of an engineer. Then you waste time from the productivity of recruiter, hiring manager, hiring engineers on the team, etc., all of whom are highly paid. You cycle through 8-10 candidates. Then you finally get the person you need. In my experience, it takes at least a month to get onboarded, usually more. And it takes at least 6 months to get to productivity levels of the engineer that just left if your new candidate is good. All in all you wasted almost 6 months of engineering time worth of productivity, which easily exceeds the money you saved not giving that 20% raise. All of this, assuming the new guy didn't negotiate more than the previous one. Seriously, get your shit together.