For many years, Windows has had WSL and now it's the second generation WSL2 and you can run graphical Linux even without a VM. It has a decent package manager out of the box, a great open-source terminal. Containers and VMs are also available out of the box. Windows also has a developers' hub, which allows you to install toolchains easily, including IDEs such as VS Code.
Meanwhile, macOS comes with its own version of CLI tools such as find, which have quite different parameters than Linux, it doesn't have a package manager, when I install an app on my iPhone, it somehow decides that I want to install it on my macOS, too, etc. And I won't even mention how poor the menubar is! I have at least 10 apps I need to install to make macOS usable - PopClip, Moom, Bartender, etc., while the Windows equivalent for things like Dock and menubar are working pretty well, including notifications - I've accidentally have clicked so many times on notification banners, covering my scroll bar or window controls. Not to mention that so many times I'm typing something in window, which has my input focus, then another window pops up, steals my input focus, and I end up trying parts of my password in the wrong window due to that!
There are so many things wrong with macOS, Apple doesn't really care to improve it, and the System Settings is growing out of control! Windows' settings are much better organized!
And, yes, macOS freezes and crashes not less frequently than Windows. In fact, I haven't had any such issues with a heavily constrained Windows 11, running in VMware Fusion!
Also, Windows now has a free equivalent of the paid CleanMyMac app, and it works pretty well. Not to mention the free security software. But even with CleanMyMac, uninstalling software leads to tons of junk all over the place.