A computer infection is a piece of code that is created to interrupt the typical performance of a computer. Infections can spread out rapidly and trigger significant damage to both individual computers and networks. Some viruses are harmless, while others can erase files, corrupt data, or even damage hardware.