Spyware is a type of malware that performs certain behaviors such as advertising, collecting personal information or changing the configuration of the user's computer, generally without appropriately obtaining the user's consent first.
Spyware is often associated with software that displays advertisements called adware, or software that tracks personal or sensitive information. It is one of the biggest pieces of Malware.
That does not mean all software that provides ads or tracks the user's online activities is bad. For example, someone might sign up for a free music service, but they "pay" for the service by agreeing to receive targeted ads. If the terms are understood and agreed with, it may be considered that it is a fair tradeoff. A user might also agree to let the company track their online activities to determine which ads to show them.
Other kinds of spyware make changes to the user's computer that can be annoying and can slow down or crash the computer, or also steal information while at it.
These programs can change the web browser's home page or search page, or add additional components to a browser the user does not need. These programs also make it very difficult to change their settings back to the original state.
Aside from the questions of ethics and privacy, spyware steals from the user by using the computer's memory resources and also by eating bandwidth as it sends information back to the spyware's home base via the user's Internet connection. Because spyware is using memory and system resources, the applications running in the background can lead to system crashes or general system instability.
Because spyware exists as independent executable programs, they have the ability to monitor keystrokes (keylogging), scan files on the hard drive, snoop other applications, such as chat programs or word processors, install other spyware programs, read cookies, change the default home page on the web browser, consistently relaying this information back to the spyware author who will either use it for advertising/marketing purposes or sell the information to another party. It is underestimated how it can actually get these files.
Licensing agreements that accompany software downloads sometimes warn the user that a spyware program will be installed along with the requested software, but the licensing agreements may not always be read carefully because the notice of a spyware installation is often couched in obtuse, hard-to-read legal disclaimers.
An example of Spyware is a keylogger, a program that holds a record of every time the user presses a key, or takes screenshots of the computer in certain time intervals.