So yes, the law grants a monopoly over intellectual property you have developed.
A company holds monopoly power when it has the power to control prices or exclude competition. All of Apple doesn't need to be a monopoly over the entire mobile phone ecosystem, it simply needs to hold monopoly power over the storefront that it represents. And oh boy does it. Lets not blur the line between the company and what it does within the app store. Hell, at one point it wanted power over others even naming things as part of an "app store", but I digress -- it's just an example of the level of control Apple really wants.
You misuse the term "monopoly" with "fair use". Monopolies are never granted. Apple most definitely holds monopoly power over its ecosystem, and as such engages in exclusionary and predatory behavior to exclude competition.
Now where this gets fuzzy is in the vein of the whole market. True, I don't
need to buy Spotify from the App Store. True, I don't
need to buy Fortnite from the App Store. But what Apple is doing is at best stifling competition within its own monopoly position, and whether the courts define it as a foremarket vs aftermarket monopoly. Many vendors have to deliberately raise prices in Apple's ecosystem to offset the requirements imposed by this system. That is definitely "controlling prices".
This isn’t remotely similar to the Microsoft situation. And it’s utterly normal and legal for platform providers to reserve APIs for internal use and for limited partners.
When it comes to Microsoft, you're incorrect. It's similar in the sense that it is a hardware platform that monopolized its position in the market to remove competition in the space of bundling IE. It doesn't have to be a phone vendor and you can split hairs here but it's similar. Apple is creating an environment where first party apps are given better treatment than 3rd party apps, no question. It's even worse because there's no issue at all that in Microsoft's case anyone could easily go and get another browser - there was no "Microsoft Store".
Yes, it's utterly normal and legal for anyone to engage in monopolistic practices, until it violates the rules of monopolistic behavior:
1. Users have no substitute for purchasing products (especially when considering aftermarket monopoly)
1a. A foremarket monopoly is "Hey, I can buy an Android vs an iPhone!"
1b. A aftermarket monopoly is "Hey I have an iPhone, how do I buy stuff now?"
1c. This doesn't have to be black and white. Apple is definitely stifling competition by requiring vendors to jump through hoops to buy software outside of the App store, and/or charging 30% for any purchase.
As for the APIs, this is another method to stifle competition. Again, consider the context. It might be legal, until you realize that this is favoritism and controlling behavior. It's perfectly acceptable yes -- until it isn't.
Does Microsoft hide APIs for reasons? Of course.
Does it only give this data out to certain vendors? Of course.
Does this prevent programs from being compiled and used on the system? Nope. Those compilers and APIs might have obfuscated data but certainly usable by all. In this case knowledge is power. There's no Microsoft Store preventing your installation of a compiled WIN32 app you can download from anywhere. Now I'm sure you'll pivot and say "well that's just SECURITY..." yeah, yeah...but not the argument. You cannot compile an app to use on iOS at all unless it is a jailbroken device -- the argument that "web apps" are similar is quite the joke. The barrier to entry is apple's App Store and its approval process.
This is why monopolies are legal until monopolistic behavior is present. The argument isn't that you're right (people can hide APIs, YES! You win!), the argument is that it's not fair and harming competition.