immunity
Immunology

Immunity Is Memory

The immune system does not simply defend against disease. It learns from it. Through variation, selection, and persistence, it builds a biological record of past encounters — one that shapes every future response.

By Felix Walker9 min read

In 1796, an English physician named Edward Jenner made an observation that would, in time, alter the trajectory of human disease. Milkmaids who had contracted cowpox, a relatively mild infection, appeared to be protected against smallpox — a disease that, at the time, killed millions and reshaped populations with a regularity that was both predictable and unavoidable.

Jenner did not know why.

He could not have known that protection from disease would come to depend not only on recognising what is foreign, but on remembering it. That the immune system, often described as reactive, is in fact predictive — shaped as much by past encounters as by present threats. Nor could he have known that this system would operate according to principles that mirror evolution itself: variation, selection, and persistence.

Immunity is not just defence. It is experience, stored in cells, distributed across tissues, and constantly revised.

A System That Learns

The immune system is often divided into two parts: innate and adaptive.

The innate immune system responds quickly and broadly. It recognises general features of pathogens — conserved molecular patterns such as lipopolysaccharides or double-stranded RNA that distinguish microbes from host cells. These responses are immediate, but they are not refined. They do not improve with exposure. They do not remember previous encounters in any meaningful sense.

The adaptive immune system does both.

When a pathogen enters the body, specialised cells called lymphocytes — B cells and T cells — are activated if they recognise specific molecular structures, known as antigens. This recognition is highly selective, down to the level of molecular shape and charge. Each lymphocyte expresses a unique receptor, generated through random recombination of gene segments during its development. This process produces an immense diversity of potential receptors, far exceeding the number of cells that can exist at any one time.

The body does not pre-encode recognition for specific pathogens. It generates diversity in advance, and relies on selection to determine which of those possibilities become relevant.

Most lymphocytes will never encounter the antigen they are capable of recognising. A small number will. When they do, they proliferate, expanding from a rare cell into a dominant population.

This is the basis of adaptive immunity: not detection alone, but expansion of what works, and retention of what has worked before.

Selection at the Cellular Scale

When a pathogen is encountered, those lymphocytes with receptors that bind effectively to its antigens are selected for expansion. This is not a passive process. Binding triggers signalling cascades that drive cell division, differentiation, and functional activation. Within days, a single cell can give rise to thousands of descendants, all carrying the same antigen specificity.

This process — clonal selection — mirrors evolution in compressed form. Variation exists within the population of lymphocytes, generated randomly during development. The environment — defined by the presence of a pathogen — imposes selection. The fittest variants expand.

What results is not just elimination of the pathogen, but the creation of memory.

A subset of these activated cells persists long after the infection has been cleared. Memory B cells and memory T cells circulate through the body, or reside in tissues, retaining the capacity to respond more rapidly and more effectively if the same pathogen is encountered again. These cells are not simply dormant. They are primed — metabolically and transcriptionally configured for rapid activation.

The second response is not simply faster. It is amplified, more targeted, and often sufficient to prevent the pathogen from establishing itself at all.

Refinement Through Exposure

In B cells, the process goes further.

After activation, B cells migrate to specialised microenvironments within lymphoid tissues known as germinal centres. Here, their receptor genes undergo rapid mutation in a process called somatic hypermutation. Unlike most mutations in biology, which are broadly distributed across the genome, these are highly targeted to the regions encoding the antigen-binding site.

Each round of mutation produces variants with slightly altered binding properties. These variants compete for access to antigen and to survival signals provided by helper T cells. Those that bind more tightly, or more specifically, are preferentially selected to survive and proliferate. Those that bind less effectively are eliminated through apoptosis.

The result is affinity maturation: an iterative process by which the immune response becomes progressively more precise over time. Antibodies produced later in an immune response can bind their targets orders of magnitude more tightly than those produced at the outset.

The system does not just remember. It improves through a process that resembles directed evolution, occurring within the lifespan of an individual.

The Cost of Specificity

This level of specificity comes with risk.

The mechanisms that generate diversity in lymphocyte receptors — recombination, mutation, junctional variability — are inherently error-prone. They are designed to produce variation, not accuracy. In doing so, they can generate receptors that recognise not only foreign antigens, but components of the body itself.

To prevent this, developing lymphocytes are subjected to stringent selection processes. In the bone marrow, immature B cells that strongly recognise self-antigens are eliminated or rendered inactive. In the thymus, T cells undergo both positive and negative selection, ensuring that they can recognise host molecules but do not respond too strongly to them.

These processes are necessary, but they are not perfect.

Some self-reactive cells escape deletion. Under certain conditions — infection, inflammation, or failure of regulatory mechanisms — they can become activated. The result is autoimmunity: the immune system directing its specificity inward, against tissues it is meant to preserve.

Tolerance is not an absolute state. It is actively maintained, and therefore vulnerable to failure.

Vaccination as Controlled Exposure

Vaccination exploits the adaptive immune system’s capacity for memory without requiring the full burden of disease.

By introducing an antigen — or a weakened or inactivated form of a pathogen — vaccines stimulate an immune response sufficient to generate memory cells, without causing severe illness. When the real pathogen is encountered, the immune system responds as though it has seen it before, deploying memory cells that act more rapidly and effectively than naïve cells ever could.

This is not an artificial override of the immune system. It is a use of its natural logic.

Different vaccines achieve this in different ways. Some use attenuated live pathogens that replicate at low levels. Others use inactivated organisms, purified proteins, or fragments of genetic material that instruct host cells to produce specific antigens. More recent approaches rely on nucleic acids, allowing cells to transiently express components of a pathogen and thereby train the immune system without exposure to the pathogen itself.

What they share is the principle that exposure shapes response — and that memory can be induced deliberately.

A System in Motion

The immune system is not static, even in the absence of infection.

Lymphocytes circulate continuously, moving between blood, lymphoid tissues, and peripheral organs in a process that ensures surveillance across the body. Memory cells are maintained, but not indefinitely. Some persist for decades, providing long-term protection. Others decline over time, requiring re-exposure or booster vaccination to sustain immunity.

New lymphocytes are constantly generated in the bone marrow and thymus, introducing fresh diversity into the system. Old cells die. The composition of the immune repertoire shifts, influenced by age, environment, and history of exposure.

Immunity is therefore not a fixed state. It is a dynamic equilibrium between memory and renewal, between what has been encountered and what may yet be.

When Memory Misleads

Immunological memory is generally protective, but it can also constrain future responses.

In some infections, the immune system preferentially recalls memory responses to previous, similar pathogens, rather than generating new responses better suited to the current threat. This phenomenon, sometimes referred to as original antigenic sin, reflects the system’s bias towards what has worked before.

This bias is efficient, but not always optimal.

If a pathogen evolves sufficiently, the memory response may recognise it imperfectly, mounting a response that is rapid but suboptimal. The immune system, in effect, applies an outdated solution to a new problem.

The system relies on past experience, but the past is not always an accurate guide. Adaptation at the cellular level can lag behind adaptation at the level of pathogens.

The Ecology Within

The immune system does not operate in isolation. It exists in constant interaction with the microbiome — the vast community of microorganisms that inhabit the body, particularly the gut.

These microbes are not pathogens. Many are essential to digestion, metabolism, and immune development. The immune system must therefore distinguish not only between self and non-self, but between harmful and beneficial non-self.

This distinction is not encoded in a simple rule. It is context-dependent, shaped by signals from tissues, microbial metabolites, and the history of interactions between host and microbes.

Early-life exposure to microbes influences how the immune system develops, affecting susceptibility to allergies, autoimmune diseases, and infections later in life. Disruption of the microbiome — through antibiotics, dietary changes, or illness — can alter immune function in ways that are still being understood.

Immunity is not just defence against the external world. It is regulation of an internal ecosystem, one that is itself dynamic and variable.

What Immunity Actually Is

It is tempting to think of the immune system as a barrier — something that keeps pathogens out.

It is more accurate to think of it as a record.

Every infection, every exposure, leaves a trace. Not as a conscious memory, but as a distribution of cells, each with its own specificity, its own history of selection and expansion. The immune system you have now is not the one you were born with. It has been shaped continuously, over years, by what it has encountered.

This shaping is not directed in any deliberate sense. It is the result of variation and selection operating at the level of cells, constrained by the biology of the organism.

Immunity is learned, but not in the way learning is usually understood. It is encoded in populations of cells, not in thoughts or behaviours.

A System Defined by Experience

The consequence of this is that no two immune systems are identical, even in genetically identical individuals.

Environment, exposure, infection history, diet, microbiome composition, and age all contribute to divergence. Over time, these factors shape the immune repertoire in ways that are specific to each individual.

What protects one individual may not protect another. What is tolerated in one context may be pathogenic in another. The immune system is not a universal solution applied uniformly across a species. It is a personalised system, built from accumulated interactions with the environment.

It reflects where you have been, biologically speaking, as much as what you are.

What Jenner Could Not See

When Jenner inoculated his patient with material from a cowpox lesion, he was not introducing protection directly. He was initiating a process.

Cells were activated. Variants were selected. Populations expanded. Memory was formed and maintained across time.

What appeared, at the level of the organism, as immunity, was the result of countless interactions at the cellular and molecular level — recognition, proliferation, mutation, selection, and persistence.

The immune system did not simply respond. It adapted, using mechanisms that would only be understood centuries later.

The Logic of Defence

What emerges from all of this is a system that operates less like a shield and more like a population.

Diversity is generated in advance. Selection acts upon it. Successful variants expand. Memory preserves the outcome, biasing future responses towards what has previously been effective.

It is evolution, compressed into the lifespan of an individual.

And like evolution, it is not perfect. It produces errors, trade-offs, unintended consequences. It protects, but it also misfires. It remembers, but sometimes too rigidly. It adapts, but not always quickly enough.

The immune system does not guarantee survival. It increases the probability.

That is enough.

Because, as with the genome, life does not require certainty. It requires systems that function well enough, for long enough, in environments that are never fully predictable.

Written by Felix Walker
Share