Both.
The reason Windows is such a security risk is that the system can be modified through the web browser.
Windows makes this possible because they feel the need to keep a lid on piracy, so there are all kinds of holes leading into the system.
Mac has none of this. You do not even need a serial number to install the OS, and nothing in any browser or in the cloud can access your system without your permission. And even your permission cannot change critical files.