Windows isn’t even that good. The OS is kind of a huge mess. It has two unfortunate advantages though: it’s the default on many devices, and (because of that) software availability is best. I wish it wasn’t the case.
It also has the benefit of inertia. Everyone knows Microsoft from either school or marketing. They are the standard and anyone else has to fight decades of standards. It also helps that they historically created the best tools for easily managing fleets on machines. Now days they are pushing everyone to Azure but before they had the best tools to build your business on. It was so convenient to have Windows server with all the server stuff like AD, SQL and IIS. They basically were they only well known option until the last 5-10 years.
PowerShell is another advantage, oddly enough, though I've been worried for a bit the direction they're going with that... Everything they're doing now is Azure and they're pushing everything to Graph, and the way all of it works is a massive pain for anyone trying to use PowerShell the way it was designed to be used
Python exists but I personally like PowerShell more. I'm not crazy about it being Microsoft owned, but it's at least open source at this point, for whatever that's worth.