Hackers didn't bother with Mac's because sales were minute.
That is not why macOS (i.e. Unix) is secure. It is secure because of the architecture.
The Windows default is to allow all users access to everything. The Windows OS engineers must lock down everything that all users should not have access to. By default, Unix denies access to all users. Users must be given specific access.
In Windows, if you fail to lock something down, chaos ensues.
In Unix, if you fail to give a user access to something they need, they just don't have access.
The root user is an exception to this rule, but macOS denies even the root user access.
In Catalina the OS is read only.
In Big Sure, not only is the OS read only, but it is also mounted on a sealed snapshot.
macOS is secure because it was designed from the ground up to be run on a multi-user network,
Windows was designed to be run on a single, air-gapped computer.
The New Technology File System was a step in the right direction, but Microsoft only integrated about half of what was suggested to secure the OS on a multi-user network.