What exactly does a worm/virus do?

Adware makes pop-ups
Keyloggers steal things
But what does a worm/trojan/virus do?

trojan:
http://en.wikipedia.org/wiki/Trojan_horse_(computing)

virus:
http://en.wikipedia.org/wiki/Computer_virus

worm:
http://en.wikipedia.org/wiki/Computer_worm