This is really just an example of the impressive security policies of macOS, if I'm not mistaken as long as you have admin permissions you can trivially create a keylogger on Windows 10 without any such special permissions.
Well if you have admin permissions, you should be allowed to do anything.
That philosophy has been very helpful to malware authors over the years. The modern approach has been to make that less of a binary decision and make sure the user can see it happening and change their mind: e.g. allow you to write an app which does something privileged but require a prompt and prevent it from hiding its actions.