Apple can (and has been) since it owns the whole stack, evidenced by the fact that they've been gradually hardening macOS software and hardware for two decades.
It's been gradual enough that most end users haven't noticed, but macOS developers are painfully aware of the security-related issues they have to reckon with in both major and minor updates to macOS. Example:
https://eclecticlight.co/2024/08/27/launching-apps-in-sonoma-14-6-1-full-security/
https://eclecticlight.co/2024/08/28/launching-apps-in-sonoma-14-6-1-reduced-security/
https://eclecticlight.co/2024/08/29/launching-apps-in-sonoma-14-6-1-known-malware/
https://eclecticlight.co/2024/09/03/launching-apps-in-sonoma-14-6-1-conclusions/