Really, Apple could have headed off regulators at the pass if they had embraced the (semi-)opening of their platform themselves. Allow third party app stores but on
their own terms, providing SDKs and APIs for creating your own iOS App Store with security checks baked in and mandating privacy protections built in. Sort of like a software services equivalent to Apple Authorized Service Providers and Apple Authorized Resellers.
They would have then controlled this debate, and there would have been less room for the Epics of the world to complain about the platform being locked down. Not to mention users would benefit from greater choice. Imagine boutique third party app stores springing up devoted to specific interests and niches such as F-Droid, or promising better curation or quality.
Companies who refuse to use the AppStoreKit that Apple so beneficently provided would then be seen as malefactors seeking to subject their users to lack of privacy and security, rather than Apple trying to uphold their 30% cut and restrictive behavior.
Instead, Apple tried to control everything and not only did they expose themselves to regulation like this, they deal with customers annoyed at scammy apps on their own App Store, and third party devs crying foul at inconsistent policing.