"Vaccines train the immune system to recognize a pathogen." This is true. It's also incomplete in ways that matter — both for understanding why vaccines work, and for understanding their limitations.

Quick answer

Vaccines expose the immune system to a harmless version, piece, or instruction set for a pathogen so the body can build immune memory before the real infection arrives. That memory lets B cells, antibodies, helper T cells, and cytotoxic T cells respond faster and more specifically than they would during a first encounter.

The immune system you need to know about

The immune system has two broad arms: innate immunity (fast, non-specific, first responder) and adaptive immunity (slower, highly specific, generates memory).

Vaccines primarily work through adaptive immunity, specifically through B cells and T cells.

B cells are the antibody factories. When they encounter a specific antigen — a molecular structure they recognize as foreign — they activate, proliferate, and differentiate into plasma cells that secrete antibodies. Antibodies are Y-shaped proteins that bind to specific molecular targets with extreme precision, neutralizing pathogens or flagging them for destruction by other immune cells.

T cells come in two main varieties. Helper T cells (CD4+) coordinate the immune response — they activate B cells, amplify the response, and support memory formation. Cytotoxic T cells (CD8+) directly kill infected cells by recognizing viral proteins displayed on cell surfaces.

Memory cells are the key to vaccination. After an infection or vaccination, some B and T cells become long-lived memory cells that persist for years or decades. These cells can respond much faster to a subsequent encounter with the same antigen — within hours rather than the 7-14 days of a primary response.

What a vaccine actually does

A vaccine introduces antigen — either the pathogen itself (attenuated/inactivated), a piece of it (subunit/protein), or instructions for your cells to make a piece of it (mRNA) — without causing disease. The immune system mounts a response, generates memory cells, and is primed for future encounters.

The type of vaccine affects which immunity it generates:

Live attenuated vaccines (measles, chickenpox) use weakened pathogens that replicate briefly but don't cause disease. Because they replicate, they generate strong, durable responses from both B and T cells, often requiring only one or two doses for lifetime protection.

Inactivated vaccines (flu shot, polio IPV) use killed pathogens. They can't replicate, so the immune signal is weaker and shorter-lived — hence annual flu shots.

Subunit vaccines (Hepatitis B, HPV) use only specific proteins from the pathogen, not the whole organism. These are highly safe but may require adjuvants (chemical additions that amplify the immune response) and boosters.

mRNA vaccines (COVID-19) deliver genetic instructions for your cells to produce a specific viral protein (like the spike protein). Your cells make the protein, your immune system responds to it, and then the mRNA degrades — typically within days. The mRNA never enters the cell nucleus and cannot interact with DNA.

Why some vaccines work better than others

Vaccine efficacy varies widely, and understanding why requires going beyond "training the immune system."

Influenza is a genuinely difficult target because it mutates rapidly. Each year, the WHO and flu surveillance networks attempt to predict which flu strains will dominate and formulate vaccines accordingly. When the prediction is right, flu vaccine efficacy is 40-60%. When the prediction misses, efficacy is lower. The vaccine isn't failing — the target moved.

Respiratory syncytial virus (RSV) vaccines for decades failed to generate the right immune response. Some early formulations actually made disease worse in children — a phenomenon called vaccine-associated enhanced disease — because the immune response generated was the wrong kind (antibody-heavy rather than cell-mediated). The more recent RSV vaccines approved in the 2020s avoid this through modified antigen design that stabilizes the protein in its prefusion state.

HIV vaccine development has failed for 40 years partly because HIV attacks and depletes CD4+ helper T cells — the very cells needed to mount an effective vaccine response — and mutates faster than broadly neutralizing antibodies can be reliably generated.

Herd immunity is about thresholds

The concept of herd immunity is straightforward but gets the numbers wrong in popular accounts. Herd immunity requires a sufficient fraction of a population to be immune such that the pathogen can't sustain transmission chains.

That threshold depends on the basic reproduction number (R₀) — the average number of people one infected person infects in a fully susceptible population. For measles, R₀ is 12-18, one of the highest known for any pathogen. To achieve herd immunity, roughly 94-95% of the population needs to be immune. For flu, R₀ is 2-3, requiring 50-67% immunity. For COVID-19 original strain, R₀ was approximately 2-3, though variants with higher R₀ raised the threshold.

This is why a 70% vaccination rate is sufficient for some diseases and insufficient for others. The number isn't arbitrary — it comes directly from the pathogen's transmissibility.

Vaccines are one of the most successful public health interventions in history. Smallpox has been eradicated. Polio remains endemic in only a handful of countries. Measles was eliminated from most of the developed world. Understanding the underlying mechanism makes the achievement clearer — and the stakes of vaccine hesitancy more concrete.

For adjacent medical explainers, read how antibiotics cause resistance, how anesthesia works, and the placebo effect.

Sources and further reading