Microsoft isn't as big as it once was. In the last decade we would obsess over their desktop hegemony and underhanded dealings, but these days not so much. Microsoft missed the boat with regards to mobile. They never entirely grokked the internet and are only recently trying to make inroads into the cloud.
My tepid take on the state of Microsoft is that they're going to be all about the cloud in the next few years. I expect Windows to become freeware or adware and to be a thin client operating system with minimal onboard processing. Anything that matters will happen in an Azure cloud and Windows laptops will be remotely managed clients, reminiscent of the days of mainframe computing. Users will be able to change a few settings, but other than that all of the software maintenance will be handled centrally.
So why did they buy Github? Was it to finally assassinate open source, their hatred of which was famously outlined within the Halloween documents?
Actually, subsequent to the Ballmer period, which ended four years ago, I think they're following a different strategy. The Windows desktop operating system is now legacy, and not their main focus. The new business model is going to be about telemetry and pushing targeted ads from the cloud to the desktop. That means they won't open source Windows but they'll try to cut its maintenance costs to the bare minimum. If they open sourced it then they'd lose control of the telemetry and ad delivery pipeline. I think the way they're going to reduce maintenance costs is by using as much open source software as they can, where they're not paying the developers. Note that here I'm using the term "open source" deliberately and not "Free Software". Owning Github puts them in a good position to do that. They can nudge things towards Azure over time in a slowly-slowly frog-boiling type of strategy and generally "communitize the community" in a Windows direction.
In the coming years I expect that Microsoft will do with Windows what Canonical has done With GNOME after Unity. An increasing fraction of the desktop OS will be maintained by the open source developer community at large and not by Microsoft. Privatize the benefits, externalize the costs. So open source, or even Free Software, is not the same kind of threat to them that it was during the Gates/Ballmer era and it may even be considered a business-critical ally.
You could object that this strategy is all about centralized cloud systems and that it fails to take into account that there is an emerging decentralization trend.
I think the decentralization trend is not quite what it appears to be. In most cases you'll find that what is decentralized is the software only and that the physical computing remains centralized within giant data centers. So even if we are entering a federated era based on ActivityPub or some similar protocol the Azure strategy would still work for Microsoft and wouldn't change their profitability much. If their Windows desktop client becomes thin enough it may also be suitable for mobile.