Computer viruses are malicious programs that can copy themselves and spread from one computer to another without permission. They infect files and can cause damage like deleting data or overwriting files. Antivirus software uses different techniques like real-time protection, on-demand scanning, automatic updates, and file quarantining to detect, remove, and prevent viruses from infecting computers. Common types of viruses include macro viruses, boot viruses, polymorphic viruses, and Trojan horses which can have various harmful effects if not addressed by antivirus protection.