By attaching itself to another program, a virus gains a host. When the host program is executed , the virus is executed. Each infected program in turn infects other programs, and the virus spreads. I make this distinction because two of the most prevalent types of damaging programs are not viruses at all. The worm worms its way into system registries and spreads as an independent program, while the trojan horse is run by the user, though unwittingly.
Computer viruses are similar to biological viruses.
The vast majority of viruses do little more than annoy, much like chicken pox. Under the right conditions, though, even chicken pox can be deadly. Regardless of the magnitude of damage caused, nobody wants chicken pox. The same issue holds with computer viruses. The classes of virus outlined here are not the only ones in existence.