Microsoft began to suffer when they forgot that they are a software company. They were believing that they are a Windows/Office company. Those cash cows were milked to death, additionally killing everything else along the way.
At some point (way later than they should have) they understood what was happening and where it leads. The solution is going back to software (and its cloud form). Sell anything, target everything. Develop for widest possible audience, but also pursue niche markets. Like Microsoft did in the '80.
Another point is developer attraction. They need "cool", and this kind of hardcore hacking is cool.
The new Microsoft wants to sell any software/service, no matter the hardware nor the OS. To transform from the old Microsoft to the new version, they need cool software. And who can make this happen? Cool developers.