I can only assume that right now the best developers are vastly underpaid relative to their worth. Why? Because it turns out every time they get annoyed with their current company they can send out some feelers and get a 20% raise. Most people can't do that. Most teachers can't just quit and get a 20% raise yearly. Do this a few times and ultimately you realize that your intrinsic value didn't really increase 1.2^3 (72%) over the last 3 jobs, it's just that companies were always willing to pay more if they needed to, but (if you were being honest about current salary) only in increments of 20%.
If they were willing to pay more, you were worth it.
There are very very few companies that exist right now that give you crappy work but top notch comp for that work. For those companies, there is not a "huge retention problem", it's just a normal-sized retention problem where in addition to paying their developers based on value they also try to ensure they get to mix things up a bit and enjoy a conference or two.
Most companies don't want to pay for retention. It's pretty sad that most companies can't make staying at their current company more attractive than the risk of starting a new job with a team/company that's unknown.