You've probably heard the term 'malware.' Malware is any type of program that is designed to do harm, or even to cause a computer to do something that the user has no control over, such as popping up ads. You are probably aware of viruses, trojan horses, and worms, but pop up windows, adware, and spyware are also considered malware. Spam could even fall into this category.
There are essentially two types of adware. The first type is harmless, as it is really only free software that is supported with advertisement within that software (only when it is being used). This first type of adware is no different than watching commercials on the television, as this is how the television stations, or in this case the developers of the software, are supported.
The second type is a bit more malicious. This type of adware will often monitor your computer usage to serve targeted ads to you, without your permission. It will often change your home page on your browser, and you may have ads popping up unexpectedly on your computer. In fact, some people call this spyware, because it does monitor your computer usage, but when it starts displaying ads, it is also adware.
Spyware, of course, is much more dangerous. It isn't typically just looking for information to serve you targeted ads. It is looking for information that can identify you, and therefore gain access to your usernames, passwords, and other information that can contribute to identity theft and credit card fraud. Spyware may actually be a trojan horse, worm, or virus, in this sense.
File sharing utilities are often used as spyware. Companies such as Bear Share and Kazaa are famous for this, and it is legal, because there is a notice about it in the user agreement that most people agree to without reading first.