Comment Its not compiling, its downloading apps (Score 0) 26
Is there any reason that macOS would be less secure than iOS or iPadOS?
In a standalone sense, sure. You can compile arbitrary code and run it on macOS. iOS and iPadOS lack compilers, lack the ability to sign code, and will not run unsigned code. Add in a Mac to compile the code, though, and that distinction goes away.
To expand on this. You can compile whatever you want and upload it to your device and run it. What you cannot do is distribute the binary in general. You have to physically plug the device into the Mac and give permission to upload and run the code. That is what is different than macOS. macOS will let you run a binary you downloaded from the internet, iOS/iPadOS will not.