They are very different companies in very different businesses. Apple is a hardware company, Microsoft is a software company. That affects everything (and is why the two are not fundamentally competitors).
I don't think one has ever been better behaved than the other at all, though. The main difference is that for most of their time, Microsoft was just in a position where it could do more harm than Apple.
Now I am what you would consider a "Full Stallman" free software guy, but you can imagine my mixed feelings when I ended up being interviewed by Business Insider on why Microsoft shouldn't be giving up with web engine for a Chromium based browser. Yes, things like Safari are proprietary junk but they still keep things like Chrome dominance at bay. Alas I feel we are better having a few proprietary systems than a singular monolithic one. Once Apple lets that one go, it is only a matter of time until Google almost single handled controls the framework of the internet.
Save us Ladybird, you are our only hope!
The problem is Apple is intentionally hobbling their web browser and forcing every other browser maker to use it, which prevents web applications that use any kind of hardware API from functioning on iOS - the only alternative being making a native app for iOS where Apple can charge a significant amount for any purchases made through the native app. Web applications threaten Apple's greed, so they forbid any other browser maker from using anything but Safari on their platform.
Microsoft got sued in an antitrust and lost just because they bundled IE with Windows - not for forbidding any other browser on the platform like Apple has been doing, which is way worse IMHO. And that's one of many reasons the DOJ is suing Apple for abusive business practices.
The DOJ noticed and is suing Apple for doing this.
I do not want to pay Apple for the privilege to develop a native app, as well as being forced to buy not just their mobile devices, but a full computer just to develop that native app on, when it could just be done as a web application. It's hurting me, a non-Apple user.
Oh wait, that’s totally not the case.
I refuse to pay Apple and buy their hardware to be able to develop a native app for their walled-garden platform, where they can then further extort me for any money my users spend through the app I create.
And the DOJ agrees with me, which is why they are suing Apple for abusive business practices.