Old-school viruses depended on a more physical distribution medium, like a floppy drive.
What has changed are viruses and malware and how they are distributed. Macs now are as vulnerable as they were back in the day. They also have tighter default security protocols when it comes to downloading and installing software, requiring you to enter a password before continuing and optionally locking down downloads to only trusted sources, thus making it more difficult for sneaky malicious programs to find a foothold. From the onset, they were usually owned more so by businesses than casual home users. Historically speaking, Macs were thought of as the “safe” operating system.