One popular way was that Internet Explorer 6 included something called ActiveX, which basically allowed any website to run code on your computer as though it was a locally-installed program. You could just click on some URL and next thing you know it's writing files to your hard drive. This is one of the main reasons why the Internet Explorer 6 / Windows XP era was particularly virus-filled. A website could open your freaking CD tray.
From the ActiveX wikipedia page:
Developers had to register with Verisign (US$20 per year for individuals, $400 for corporations) and sign a contract, promising not to develop malware.
Promising not to. And they did it anyway. The bastards.