Spyware is software that is downloaded onto a computer with out the users consent and then secretly collects and forwards information or displays advertising e.g. Keyboard loggers and screen capture
Spyware as a category overlaps with adware. The more unethical forms of adware tend to coalesce with spyware.
Malware uses spyware for explicitly illegal purposes
Barnacles can be classified as a special type of spyware ( Barnacles are data collection and/or advertisement producing software they normally targets the winsock protocol to redirect data from a system's TCP/IP stack . Removal it usually corrupts Internet protocols, thus requiring a reinstallation of the TCP/IP stack)