When a Virus is affecting the computer

Hello! What happens when a virus gets in a computer and start affecting its performance? I want to know how exactly does it slows the computer and the computer starts crashing too often. Is it a file which is actually a virus? Are there more than one ways of affecting a computer? Are there different kinds of viruses? What is the most dangerous type of a virus?
