The immune system is a system of biological structures and processes within an organism that protects against foreign invaders called antigens. To function properly, an immune system must detect a wide variety of foreign agents like pathogenic bacteria and viruses and distinguish them from the organism's own healthy tissue. The immune system protects the body against diseases. Basic immune mechanisms evolved in ancient eukaryotes and remain in their modern descendants include phagocytosis, defensins, and the complement system. Humans have a more sophisticated defense mechanisms that includes the ability to adapt over time to recognize specific pathogens more efficiently. Adaptive immunity includes the creation of immunological memory after an encounter of the immune system to a specific pathogen and the initial response to it, leading to an enhanced response to subsequent infection with the same pathogen. This process of acquired immunity forms the basis of vaccination. Immune system disorders includes and results in inflammatory diseases, autoimmune diseases, and cancer while Immunodeficiency disorders occurs when the immune system is less active than normal, resulting in recurring and life-threatening infections.