A drive-by download is the infection of a computer with malware when a user visits a malicious website.
Drive-by downloads occur without the knowledge of the user. Simply visiting an infected website may be sufficient for the malware to be downloaded and run on a computer. Vulnerabilities in a user’s browser (and browser plug-ins) are exploited in order to infect them.
Hackers continually attack legitimate websites in order to compromise them, injecting malicious code into their pages. Then, when a user browsers the legitimate (but compromised) site, the injected code is loaded by his/her browser, which initiates the drive-by attack. In this manner, the hacker can infect users without having to trick them into browsing a specific site.
To defend against drive-by downloads, you should have effective endpoint security software coupled with web-security filtering.