Free with the purchase of Apple hardware. Not exactly "free," is it?
VS Code works on Mac, Linux, and Windows.
Correct. And Apple artificially requires that you have a Mac to develop software for Mac or iOS.
Not even Microsoft does that. I can compile for Windows on any platform.
Xcode was designed for writing Mac apps, why would anyone want to write Mac apps on a PC, when they'd need a Mac to test them anyway?
It's only after the iPhone that the question of a port to other platforms has arisen. But that would be a huge task equivalent to a full rewrite. Even Apple doesn't have the resources to pull that off smoothly.
There are many reasons. I was going to list a few, but ehh. If you want to know you can probably ask Google or StackOverflow.
Microsoft's revenue split for the Windows Store is an identical 30%[0] (in most cases). There is, of course, the benefit of not having to pay any annual registration fees on Microsoft's platform.
[0]: https://docs.microsoft.com/en-us/legal/windows/agreements/ap...
[1] https://blogs.windows.com/buildingapps/2018/05/07/a-new-micr...
For the time being, my comment stands.
If you want to write apps for macOS and distribute them yourself you can do so with no cost.
^and some "CodeLense" feature that I've never used.
http://www.visualstudioresources.com/2017/07/09/differences-...