Macs get hit by malware, even ransomware. Yes, macOS has better built-in defenses and fewer users overall, but that also means that a malware attack doesn’t have as much competition. Windows and Android are the most popular targets for malware coders, but that doesn’t mean macOS is immune.