Well how does one become infected with malware like this in the first place?
- You pirated software
- You installed shareware from disreputable places
- You pirated software
- You fell victim to phishing emails or text messages
- You pirated software
- A rogue advertisement convinced you to install some fake cleaner or antivirus app
- You pirated software
- You installed a weird game you downloaded from a weird website
- You pirated software
- You don't run an adblocker
Most of the malware out there is adware that hijacks your browser home page and search and delivers pop-ups, etc. Some install background digital currency miners. Others steal passwords and hack your bank accounts, etc. The really dangerous stuff would most likely be blocked by macOS security measures providing you've been updating macOS all along. Considerable numbers of Mac users either do not update or refuse to buy a new Mac when their old one has become obsolete. I just spoke with someone who had a 13 year old iMac. Very vulnerable to attacks.
I am not so sure I buy all the hype on XLoader. it apparently steals passwords from "from web browsers and some email clients (Chrome, Firefox, Opera, Edge, IE, Outlook,Thunderbird, Foxmail)". No mention of the keychain or Safari or 1Password or the like. I would need to see the professional analysis by Check Point Software to know more.
Most of this stuff doesn't use an exploit it relies on the user granting it permissions to install and run.
The worst stuff is nation-state such as that Messages attack that an Israeli security firm developed and only sells to governments. This is an active ZeroDay that Apple has yet to discover and patch. All they have to do is text message an iOS/iPadOS/macOS and they own your device. But mostly those targeted are activists and journalists, etc.