The fact that you cannot begin to imagine a world where Apple's engineering capabilities exists beyond the App Store, nor are aware of the many, many security features they have enabled on both iOS and MacOS [0], speaks of your own skepticism towards Apple's ability to get the job done beyond the App Store. I suggest you read up on Apple's work into system security [1] and elsewhere. It's quite fascinating!
[0] https://support.apple.com/guide/security/app-security-overvi...
[1] https://support.apple.com/guide/security/system-security-ove...