This is a very complex topic. You might start with Wikipedia and work your way through the various types of threats out there. Adware, Malware, Viruses, Denial of Service, Rootkits, Botnets, Worms, Spyware to name a few.
If you stick to mainstream websites you are less likely to encounter malware and viruses. It is people using search engines and venturing to lesser traveled parts of the web that are most susceptible to infection. Less traffic, less people reporting problems, and the lesser likelihood of there being a full time staff to handle such issues.
I would say the most common type of malware will come in the form of advertisements. Depending on the source of the advertisements nasty people can sneak in malicious code every once in a while. If they are one of the major ad firms, it will be quickly taken care of. However, the return vs risk is quite high. If you can slip a bad ad into an ad service for even a short period, as long as they have enough customers you might get thousands of victims. And if the end goal is something like user accounts, passwords, or credit card numbers, they can net a tidy profit quite quickly.
Enterprise/School sometimes have a hardware firewall running that prevents some types of code from passing through the network. Basically any sneaky ports or unexpected traffic not directly requested by the clients wouldn't be able to get through.
Basically if you stick to google, don't click on the advertised links right away, keep a mental list of trusted websites, keep your computer and browsers up to date, you can be pretty safe on the web.
People who don't have much computer knowledge will click on things they shouldn't. As mentioned, with most modern OS it takes user action to get an infection. So they might have been trying to download one thing, but were sent another.
Lately a few companies, Lenovo is a good example, have been caught putting adware on their base image OS they distribute with their hardware. So even best practices can't keep you 100% safe. (Theirs basically changed the sponsored links and banner ads seen in browsers to someone elses)