The reason is simple: your Mac already comes with an antivirus out-of-the box, called XProtect. It works exactly like third-party antivirus scanners, by looking for "signatures" of known malware. When XProtect detects known malware, it blocks it, moves it to the Trash and alerts the user.