I literally buy iPhone mostly because of the walled garden. It's by far the biggest value add they have, and they grew to the scale they are in large part because of the value that adds.
If you want to sell an app on iPhone, you have to follow their human interface guidelines. You have to respect users' privacy (not enough, but as much as they can enforce). You used to be required to take payment through Apple's payment methods that make it incredibly easy to track and cancel subscriptions. Courts taking the payment rules away makes my experience worse. A shitty law forcing Apple to allow apps to pull out of the App Store and do whatever they want would make my experience much worse. (Thank God I'm not in the EU or subject to that.) If I was in the EU, the government be stealing a large portion of the value of the phone I paid for from me, to be replaced by stuff I can already do if I really want to.
These laws aren't giving power to the people. They're taking away Apple's power to protect people and giving the power to fucking China through epic.
Facebook/ten cent/etc have literally zero reason to stay off the play store. Google encourages them to be malware, and doesnt curtail their bad behavior is any way.
Apple doesn't. They might not leave while they think they can also destroy the security of iOS in the US, but it is a complete and utter certainty that the literal day any similar law takes effect in the US that Facebook and all their apps leave the App Store completely. They absolutely can trivially walk people through the steps from their website and the apps that are already installed, and they already have the monopoly to force their users to deal with it.
Apple isn't Reddit, building a market by claiming to be open then locking it down. They built their market because the walled garden is a massively better product.