The set of cells, tissues and molecules that defends the body against infection. It operates in two connected layers: a fast general response, and a slower one that adapts to the specific threat and remembers it.

Blood cells. The white cells are the mobile component of the immune system, circulating and entering tissue where they are needed.
Blood cells. The white cells are the mobile component of the immune system, circulating and entering tissue where they are needed.Credit: Bruce Wetzel (photographer). Harry Schaefer (photographer) (Public domain).

The innate system responds within minutes to hours, to broad categories of threat rather than to specific organisms.

Barriers come first. Skin, mucus, stomach acid, tears and the normal microbial population of the body prevent most organisms from establishing themselves at all.

Cellular defences follow. Phagocytes, including neutrophils and macrophages, engulf and destroy microorganisms. Natural killer cells destroy infected and abnormal cells.

A neutrophil engulfing bacteria. Phagocytosis is among the oldest defences, present in animals long before adaptive immunity evolved.
A neutrophil engulfing bacteria. Phagocytosis is among the oldest defences, present in animals long before adaptive immunity evolved.Credit: Volker Brinkmann (CC BY 2.5).

Molecular defences include the complement system, a cascade of proteins that punctures bacterial membranes, marks organisms for destruction and recruits cells.

Inflammation is the coordinating response. Blood vessels dilate and become permeable, allowing cells and proteins into tissue, which produces the redness, heat, swelling and pain that name it. Fever is part of the same response, and moderate fever appears to be useful rather than merely a symptom.

The innate system recognises patterns common to many pathogens and absent from host cells, which is how it distinguishes threat from self without prior exposure.

Activation of T and B cells. The adaptive response is slow on first exposure because the few cells matching a given threat must first be found and multiplied.
Activation of T and B cells. The adaptive response is slow on first exposure because the few cells matching a given threat must first be found and multiplied.Credit: Immcarle105 (CC BY-SA 4.0).

The adaptive system takes days to respond initially and is specific to the particular pathogen.

B cells produce antibodies, proteins that bind a specific target and neutralise it, mark it for destruction, or activate complement.

T cells come in several kinds. Helper T cells coordinate the response by activating other cells. Cytotoxic T cells kill infected cells directly. Regulatory T cells suppress responses, which prevents attack on the body's own tissue.

The specificity is generated before any exposure. Each developing lymphocyte rearranges its receptor genes randomly, producing an enormous variety of receptors across the population of cells, far more than the genome could encode individually. When a pathogen appears, the few cells that happen to match it are selected and multiply. This is clonal selection, treated in its own capsule.

Cells that would attack the body's own tissue are largely eliminated during development, and this is where autoimmune disease begins when it fails.

After a response resolves, a population of memory cells persists. A second encounter with the same pathogen produces a response that is faster, larger and of higher quality, often preventing symptoms entirely.

This is why most childhood infections are contracted once, and it is what vaccination exploits: presenting a harmless form of a pathogen, or a distinctive part of it, generates memory without the disease.

Antibody quality also improves through affinity maturation, in which B cells mutate their receptor genes during a response and those binding better are preferentially selected. This is evolution by variation and selection operating inside a single body over days.

Autoimmunity is a response against the body's own tissue, as in type 1 diabetes, rheumatoid arthritis and multiple sclerosis. It is treated in its own capsule.

Allergy is a response to something harmless, mediated by a particular antibody class and producing effects from mild irritation to fatal anaphylaxis.

Immunodeficiency may be inherited or acquired. HIV is the major acquired cause, destroying helper T cells and therefore the coordination of the entire adaptive response, which is why the resulting illness presents as vulnerability to organisms that are otherwise harmless.

Transplant rejection is the system working correctly on a target it should not attack, which is why transplantation requires immunosuppression, and why that suppression carries infection risk.

Cancer involves immune evasion. Tumours arise from the body's own cells and develop mechanisms to avoid detection, and checkpoint inhibitor drugs, which release the brakes the tumour exploits, have produced durable responses in cancers that were previously untreatable. That work received the Nobel Prize in 2018.

The immune system is the reason a body in constant contact with microorganisms is not continuously infected, and its failures define large areas of medicine, from allergy and autoimmunity to transplantation and oncology.

It also solves a problem of a distinctive kind: recognising an effectively unlimited variety of threats, most of which no ancestor encountered, using a finite genome. The solution, generating diversity at random and then selecting what works, is unusual in biology and is why the system can respond to pathogens that did not exist when the person was born.