I see this point, and others similar to it brought up often, and I think it stems from misunderstanding what antitrust regulation is trying to solve.

By the way, I say this respectfully, not as a dig towards you.

From a US antitrust perspective, almost all commerce has anticompetitive characteristics.
Think about it: very few businesses will act in a manner beneficial to their competitors. Most will actively act against the interest of their competitors, but almost all will not go out of their way to facilitate their competitors (passive anticompetitive behavior, if you will).

Straightforward concepts to understand what I’m trying to say here are things such as Pizza Place A not selling stuff made by Pizza Place B.
Closer to home, another example would be a device manufacturer, like a smart thermostat, not allowing their competitors to create software and apps that replace their software.

Behavior like this can be found all across commerce, from small businesses and startups to big corporations.

So the legislators (to a lesser degree) and the courts, understanding that laws need to be applied equally regardless of who the parties are, recognized that if they’d purely penalized anticompetitive behavior in a general sense, it would severely impact commerce in general.
Even prevent competition to a degree by preventing new market entrants from making their products work exclusively for their own benefit.

Analogous to this is the idea of penalizing all monopolies.
The issue with that would be that so-called “organic monopolies,” sometimes also called “innocent monopolies” (i.e., companies that gained a dominant market share by merely being successful), would be punished for their success alone.

Instead of banning all anti-competitive behavior, and analogous to this, banning all monopolies, they came up with the idea that only those that leverage their market dominance to protect or increase their market dominance should be penalized.

There are a bunch of nuances to be had, but in a nutshell, this means that imposing something onerous is okay while you don’t have dominant market power, but doing it while you have dominance would be a no-go.

Subsequently, this also means retroactively penalizing particular behavior initiated before gaining market dominance is generally not done because it indirectly punishes success.

Circling back to the example of Safari (or WebKit, to be exact), when Apple imposed this rule, it had an insignificant market share and little leverage. Because they maintained this rule from the beginning, this would not be deemed an antitrust issue.

Had Apple not imposed this from the start, but instead, had they started imposing this after they gained market dominance, then it could be an antitrust issue because now you’re leveraging your market dominance against parties who may not be able to withstand this pressure due to a variety of reasons such as being dependent on the ecosystem.

Apple is very conscious of this, which is why it generally starts with a very restrictive set of conditions, and sometimes, along the way, it loosens the reigns because doing the opposite way is not an option for them from an antitrust perspective.

Two clear examples of this come to mind.

First is the App Store, and it's often derided commission. Apple started with a simple 30% commission fee.

Later, they provided a 15 percent point discount on recurring subscriptions after the first year, followed by the same discount for streaming services in the Apple Video Partner Program, followed later by the same discount for developers in the Small Business Program.

Had they done this the other way around, say they started with 15%, learned after gaining market dominance that the 15% wasn’t sustainable, and then tried to increase it to 30%, they would be opening themselves up to antitrust penalties.

Related to this are their guidelines that prescribe what kind of apps are needed to implement IAPs. It started with all apps that provide products and services that weren’t consumed outside the app (i.e., physical).
Then they added the so-called “Reader exception,” later, they exempted free apps that are a companion to specific online tools such as email and cloud storage.

Now that they allow game streaming services, they need to offer IAPs for services sold outside the app, at least for now, because they can always loosen the requirements but never tighten them.

The other example is their relationship with carriers. When Apple launched the first iPhone, and they were insignificant on the mobile phone market, they were only willing to partner with carriers that accepted their prohibition of installing bloatware on the iPhone.

A couple of years later, when they had gained a significant market share, Apple decided to implement Hotspot functionality, FaceTime, and FaceTime audio.

It stands to reason that Apple wanted all carriers to support this functionality on their terms (i.e., without impediments for users), but taking the same stand on this as they took on bloatware, something that would’ve been way easier now that iPhones were a hot commodity, could be seen as levering their market position.

The result is that carriers could do as they wanted with these functions by carrier profiles. In the beginning, a lot of carriers would turn off the hotspot functionality on some plans and would disable FaceTime use on the cellular network; later on, the carriers relaxed with FaceTime usage on their network, but many now put a data cap of sorts on hotspot usage.

Clearly, Apple felt it might lead to antitrust issues if they told carriers to fully support these functions or not expect to be supplied any iPhones for them to sell.