Spyware is a class of malware that, as its name implies, is typically designed to spy on you or your computer, silently collecting information that is subsequently sent on to others for typically nefarious purposes.
Various forms of advertising, including additional toolbars, homepage hacks, and data insertion (while technically not a form of spying) are often also included in the term spyware.
While very similar to viruses, spyware detection differs from virus detection in that it’s more behavioral; it watches what your computer is doing to determine the presence of spyware. Virus detection is more typically data-based, looking for specific patters of data that indicate the presence of a virus.
In reality, the lines between spyware and other forms of malware tend to blur, although typically a protection solution for each is still required.
Spyware is software with malicious behavior that aims to gather information about a person or organization and send it to another entity in a way that harms the user. For example, by violating their privacy or endangering their device's security. This behavior may be present in malware as well as in legitimate software. Websites may engage in spyware behaviors like web tracking. Hardware devices may also be affected. Spyware is frequently associated with advertising and involves many of the same issues. Because these behaviors are so common, and can have non-harmful uses, providing a precise definition of spyware is a difficult task.