It is my opinion that developer ability is on a Pareto distribution, like the 80 20 rule when 80% of the work is done by 20% of the people. The job market is more liquid for those that are extremely productive so it’s pretty easy to for them to get a pay rise of 30% by switching companies. In the worst case you can often come back with a promotion because, like many companies, Microsoft is more likely to promote you when trying to poach you back. Doing a 2 year stint at Amazon was quite common. The other problem is that when your best people leave is that the process is iterative, not only are you getting paid less but you are now working with people who couldn’t easily switch jobs. You start being surrounded by incompetence. Stack ranking, which I hear is still being done unofficially, also means that you put your promotion and career in danger by joining a highly productive team. So it is rather difficult to get highly productive people to work on the same team.
Being paid less, being surrounded by incompetence, and being forced to engage in constant high stakes politicking really sucks.
Otherwise as you said the only way is to offer the best compensation so that people don't leave. But again those people probably would leave for different reasons (culture e.g.).
But the actual issue is that if you underpay people they will not feel respected and valued so they will either not be motivated or leave. So you cannot pay below market, but you do not need to pay FB salaries either.
Also compensation is a sign of respect and influences motivation. If you position yourself lower in the market, there is no reason to deliver top results for less money, correct? This attracts mediocrity, especially in management, and slowly kills companies. Usually there is no way back, no large company can replace the entire management and once and the mediocre ones will reject new, better ones.
And the fact that it's impossible to poach people from companies offering a higher salary than you do. Unless you give them something more, like better conditions, or "mission", or the idea to work on something cool, but I don't think any of those apply to Microsoft.
I don't know. I know there are a lot of people who want to work on the OS source code, given the chance, but need some hand holding in the beginning. Companies in general are not willing to give them the chance, because they don't want to hand hold them.