Researchers at Trend Micro have recently discovered a malware strain they've dubbed XCSSET which is especially good at bypassing Apple's security measures. As Apple products surged in popularity hackers took note and began finding ways around Apple's impressive security measures. That is still true but the gap has now virtually disappeared. For many years the company was able to rightly claim that Microsoft had a far worse problem with malware than Apple did.
Apple is generally very good about providing its users with a safe and secure computing environment.