No computer system is immune to viruses (at least not yet). After all, viruses are just programs and all computers were designed to run programs. But Macs have had several factors in their favor in the fight to stay healthy?
Some suggest that Macs keep such a stellar reputation due to market share [source: Poremba]. Who'd want to write a virus for 100 computers when you could reach 1 million? The disparity isn't that big between the number of Macs and PCs, but you get the point. Not everyone agrees with the market share theory, though, claiming that Macs really do offer fewer opportunities for malicious code to spread [source: Porten]. The bottom line: Macs are not invulnerable and can get infected.
Another myth revolves around the UNIX foundation of Mac OSX (Mac operating system ten). Architecturally, UNIX is built with a more robust permission structure that prevents unauthorized execution of software. While Microsoft Windows will try to run a program any way it can, even if a virus is redirecting things, UNIX will stop in its tracks when it detects an unauthorized redirection and limit any damage [source: Perrin].
This is great, but it doesn't make your computer immune. It's similar to how exercising and eating right will help you stay healthier, but if a strong enough flu bug comes around you're still in for some misery. To infect a Mac, the viruses just need to be written well enough to get around the architecture. Not easy, but completely do-able [source: Rooney].