The immune system is a system of structures and processes within an organism that protects against disease. It must detect a wide variety of pathogens – from viruses to parasitic worms – distinguish them from the organism's own healthy tissue, and neutralise them. Simple unicellular organisms such as bacteria have enzymes that protect against bacteriophage infections. Other basic immune mechanisms, including phagocytosis, antimicrobial peptides called defensins, and the complement system, evolved in ancient eukaryotes and are found in plants and invertebrates.
Humans and most other vertebrates have more sophisticated defence mechanisms, including the ability to adapt over time to recognise specific pathogens more efficiently. Adaptive immunity creates immunological memory after an initial response to a specific pathogen, leading to an enhanced response to subsequent encounters with that same pathogen. This process of acquired immunity is the basis of vaccination. Viruses and other pathogens can rapidly evolve to evade immune detection, and some viruses, notably HIV, cause the immune system to function less effectively.