There are demographics where Apple has dominance.
M Pro series are probably the best laptops on the market, and if people keep buying them, is the price too much?
MacBook Air is actually quite well priced for what you get.
As such both Windows and MacOS are closed source.
As for “opening up the OS” both are pretty gosh darned flexible and extensible wrt other features.
However being based upon a BSD core, MacOS has had access to the Unix command line natively since forever. For Windows one used to have to rely on CgyWin before the virtualized WSL platform came to be.
Whilst MacOS has the somewhat opaque ~/Library for storing user settings and data, it pales into comparison to the massively Opaque Windows Registry.
I’ve had had very few issues fixing app install issues with my Mac - with Windows I’ve had more than one occasion where I’ve had to do a complete reinstall of the OS due to the Registry being totally hosed to the point I couldn’t reinstall apps again.