Often this is via special entitlements [0]. Published APIs, which you're only allowed to use if Apple approve your request.
Apple typically don't publish the criteria for when they approve entitlements, so it's almost impossible to get approved. You need to be a big company with contacts inside Apple.
Meta, Google etc. will all have negotiated a bunch of these entitlements for their own apps. But smaller companies are totally shut out.
[0] https://developer.apple.com/documentation/bundleresources/en...