A vaccine does not treat a disease. It works entirely before any real infection occurs, by presenting the immune system with a harmless preview of a pathogen — a weakened or inactivated form of it, a fragment of its surface proteins, or, in newer mRNA vaccines, instructions for cells to briefly produce one of those fragments themselves. The immune system responds to this preview as though it were a genuine threat, and in doing so builds a form of biological memory that allows it to respond dramatically faster and more effectively if it ever encounters the real pathogen later. Understanding how that memory is built explains both why vaccines work and why their protection can vary in how long it lasts.
The First Encounter Is Slow
The first time the immune system encounters a genuinely new pathogen, its response is comparatively slow. Specialised cells must first identify the invader as foreign, then activate and multiply B cells and T cells carrying receptors that happen to match it — a selection and expansion process that typically takes one to two weeks to reach full strength. This delay is exactly why a first infection with a novel pathogen can cause serious illness: the adaptive immune system's most effective, targeted defences are not yet ready, and the body must rely on slower, more general defences in the meantime.
Memory Cells Change the Timeline Completely
After that first response, whether triggered by an actual infection or by a vaccine, a subset of the B cells and T cells that were activated do not die off once the threat is cleared. Instead, they become long-lived memory cells, which persist in the body, in some cases for decades, primed and ready to recognise that specific pathogen again. On a second encounter, these memory cells allow the immune system to mount a full, targeted response within days rather than weeks, often clearing the pathogen before it produces any noticeable symptoms at all. This is the entire mechanism a vaccine is designed to exploit: triggering the creation of memory cells using a version of the pathogen that carries little or no risk of causing serious disease itself.
Why Some Vaccines Need Boosters and Others Do Not
The durability of vaccine-induced memory varies considerably depending on the specific vaccine and pathogen involved. Some vaccines, such as the measles vaccine, appear to produce memory cell populations that remain protective for decades, in some studies apparently for life. Others require periodic booster doses, partly because the initial memory cell population generated was smaller or less durable, and partly because some pathogens, particularly rapidly mutating ones like influenza, change their surface proteins over time in ways that make older memory cells less able to recognise newer variants — a phenomenon that requires updated vaccines targeting the newer variant rather than simply repeating exposure to an older one.
A System Built on Anticipated Threats
Global immunisation guidance, coordinated by bodies including the World Health Organization, is built directly on this underlying immunological mechanism — timing doses to allow adequate memory cell development, and updating vaccine formulations when a pathogen's relevant surface proteins shift enough to reduce the effectiveness of existing memory. What a vaccine ultimately provides is not artificial protection bolted onto the body from outside, but an accelerated, low-risk rehearsal of a process the immune system already knows how to run — trading a slow, uncertain first encounter with a real pathogen for a controlled one that leaves the same lasting memory behind.
This same memory mechanism is also why widespread vaccination protects people who are not vaccinated themselves, a phenomenon known as herd or community immunity. When enough of a population carries protective memory cells against a pathogen, chains of transmission struggle to find enough susceptible hosts to sustain an outbreak, indirectly shielding people who cannot be vaccinated for medical reasons or whose own immune response was weaker than average. The memory being built is individual, cell by cell, but its protective effect extends well beyond any single immune system.