For macOS:
Applications may have permission to access files/services that other apps and even root (I believe) would need user-prompt access to, gated by TCC (potentially including sandboxed game’s data).
Code signed games that opt into enabling library validation should prevent the issue of loading arbitrary code, however many games likely don’t do this.
https://unity.com/security/sept-2025-01/remediation explains these details fairly well in macOS section