How Vaccines Actually Work: The Immune System Story

Photo: Thirdman / Pexels
Vaccines work by tricking the immune system into thinking it has already survived an infection, so that when the real pathogen arrives, the response is fast enough to stop disease before it takes hold. That trick relies on one of the most elegant features of vertebrate biology: immunological memory. This article explains the full mechanism — from the moment a vaccine enters your arm to the decades-long protection that follows — and covers the 2026 frontier of cancer vaccines that apply the same principles to tumor cells.
The Two Armies: Innate and Adaptive Immunity
Your immune system runs two distinct defense programs, and understanding both is essential for understanding how vaccines work.
Innate immunity — the non-specific, rapid first-response system that activates within minutes to hours of detecting foreign material, using pattern-recognition receptors to flag anything that looks molecularly "non-self."
Adaptive immunity — the slower, highly specific system that takes days to weeks to fully activate, produces antibodies tailored to a specific pathogen, and retains memory of that pathogen for years or decades.
When a pathogen breaches the skin or mucosal barriers, the innate system responds immediately. Macrophages (large cells that engulf and destroy invaders) and dendritic cells (sentinel cells stationed throughout tissues) detect molecular patterns common to bacteria and viruses — things like lipopolysaccharide on bacterial outer membranes, or single-stranded RNA characteristic of many viruses. This triggers inflammation: blood vessels dilate, immune cells flood the site, and fever raises the body temperature to slow pathogen replication.
Critically, dendritic cells act as messengers between the two systems. After engulfing a pathogen, a dendritic cell carries fragments of its proteins — called antigens — to the nearest lymph node and presents them to the adaptive immune cells waiting there.
Source: Janeway, C.A. et al. (2001), Immunobiology: The Immune System in Health and Disease, 5th edition, Garland Science — foundational immunology reference.
B Cells, T Cells, and the Adaptive Response
The lymph nodes are where the real intelligence of the immune system lives. Inside them, two types of white blood cells — B cells and T cells — wait in enormous diversity, each one genetically programmed to recognize a slightly different molecular shape. This diversity, generated by a process of controlled DNA shuffling during development, means that for almost any antigen a pathogen can present, there is at least one B cell or T cell in your body with a receptor that fits it.
B cell — a lymphocyte (white blood cell) that, when activated, differentiates into plasma cells and produces antibodies: Y-shaped proteins that bind specifically to a target antigen.
T cell — a lymphocyte that comes in two main subtypes: helper T cells (CD4+), which coordinate the immune response, and cytotoxic T cells (CD8+), which directly kill infected cells.
When a dendritic cell presents an antigen in the lymph node, helper T cells that recognize the matching shape become activated first. They then release signaling proteins called cytokines that activate B cells bearing the same antigen specificity. Activated B cells proliferate rapidly and begin producing antibodies. A process called affinity maturation — in which B cells that produce slightly better-fitting antibodies are preferentially selected — means the antibody response sharpens over the course of days.
Cytotoxic T cells, once activated, patrol the bloodstream and tissues looking for body cells displaying the target antigen on their surface — the sign that a cell has been infected. When found, cytotoxic T cells inject proteins that trigger the infected cell to self-destruct, limiting the spread of the pathogen.
The entire adaptive response takes roughly 7 to 14 days during a first exposure. That window is why diseases can be serious before immunity kicks in. After the infection is cleared, most of the responding B and T cells die off in a process called contraction. But a small subset survive as memory cells — long-lived sentinels that persist for years and can mount a much faster response (within 24–72 hours) if the same antigen appears again.
Source: Murphy, K. & Weaver, C. (2016), Janeway's Immunobiology, 9th edition, Garland Science.
How Vaccines Exploit Immunological Memory
A vaccine is, at its core, a controlled first exposure. It introduces the immune system to something that looks enough like a pathogen — or one specific part of a pathogen — to trigger the adaptive response and generate memory cells, without causing actual disease.
The variation between vaccine types lies in what exactly is introduced and how that introduction is made.
Traditional Vaccine Designs
Live-attenuated vaccines use a weakened (attenuated) form of the pathogen that can still replicate briefly but can't cause disease in healthy individuals. Because the pathogen replicates, the immune system is exposed to many antigens across multiple rounds, generating strong, broad, often lifelong immunity. The MMR vaccine (measles, mumps, rubella) and the yellow fever vaccine use this approach. The tradeoff: live pathogens require careful cold-chain storage and carry a very small risk in immunocompromised individuals.
Inactivated vaccines use pathogens killed by heat or chemicals. They can't replicate, so the immune response is generally weaker and often requires booster doses. The polio (Salk) vaccine and seasonal influenza shots use inactivated virus.
Subunit vaccines skip the whole pathogen entirely and deliver only specific proteins known to provoke a strong immune response — the antigens. The hepatitis B vaccine and the whooping cough component of the DTaP vaccine are subunit vaccines. These are highly stable and safe but often require adjuvants (more on those below) to generate a strong enough response.
Toxoid vaccines target not the pathogen but the toxin it produces. The tetanus and diphtheria vaccines immunize against inactivated toxins rather than the bacteria themselves.
Source: WHO (2023), "Types of vaccine" — World Health Organization immunization factsheet.
The mRNA Revolution: Instructions Instead of Proteins
The COVID-19 pandemic accelerated widespread deployment of a vaccine platform that had been in development for decades. mRNA vaccines don't deliver a protein, a killed pathogen, or even a gene. They deliver a temporary instruction set.
mRNA vaccine — a vaccine that delivers messenger RNA encoding the sequence of a target antigen (typically a pathogen's surface protein), instructing the body's own cells to manufacture that antigen and present it to the immune system.
Here is the sequence of events after an mRNA vaccine injection:
- The vaccine contains lipid nanoparticles — tiny fat bubbles — that protect the fragile mRNA molecule and ferry it into muscle cells at the injection site.
- Inside the cell, ribosomes read the mRNA and produce the encoded protein — in the case of the COVID-19 vaccines, the spike protein of SARS-CoV-2.
- The cell displays fragments of this protein on its surface via molecules called MHC receptors, the same mechanism by which infected cells normally flag themselves for immune surveillance.
- Dendritic cells pick up the antigen and carry it to lymph nodes.
- The standard adaptive immune response proceeds: B cells produce antibodies against the spike protein; cytotoxic T cells learn to kill cells displaying it; memory cells form.
- The mRNA itself degrades within days. It never enters the cell nucleus, and it cannot integrate into genomic DNA — the molecular machinery required for that (reverse transcriptase) is not present in normal human cells.
The speed advantage of mRNA vaccines is significant. Once a pathogen's genome is sequenced and the target antigen identified, a new mRNA vaccine can theoretically be designed and synthesized within days. The SARS-CoV-2 spike protein sequence was published on January 10, 2020. Moderna's Phase 1 trial began on March 16, 2020 — 66 days later, setting a record that would have been unimaginable with any previous platform.
Source: Pardi, N. et al. (2018), "mRNA vaccines — a new era in vaccinology," Nature Reviews Drug Discovery 17: 261–279.
What Adjuvants Do and Why They Matter
Subunit vaccines and many inactivated vaccines face a fundamental problem: the immune system is not very alarmed by a lone protein sitting in muscle tissue. Without a sense of danger — without the molecular patterns that normally accompany a living invader — the adaptive response is weak.
Adjuvant — a substance added to a vaccine formulation that non-specifically stimulates the innate immune system, increasing the magnitude and duration of the adaptive immune response to the accompanying antigen.
The oldest and most widely used adjuvant is alum (aluminum salts), which has been in vaccines since the 1920s. Alum works partly by creating a slow-release depot at the injection site, prolonging antigen exposure, and partly by directly activating innate immune receptors on dendritic cells.
Newer adjuvant systems are more sophisticated. AS04, used in the hepatitis B and HPV vaccines, combines alum with a bacterial lipid that directly activates a specific innate immune receptor (TLR4), producing a much stronger and more durable response. AS01B, used in the shingles vaccine Shingrix, generates an immune response so robust that the vaccine is about 97% effective against shingles — extraordinary for a vaccine targeting an established latent virus.
The adjuvant in a vaccine also explains much of the soreness and redness at the injection site. Those are signs of innate immune activation — exactly what the vaccine is designed to produce. A sore arm is the immune system waking up.
Source: O'Hagan, D.T. et al. (2017), "AS04, an Aluminum Salt- and TLR4 Agonist-Based Adjuvant System," Clinical Infectious Diseases 64(S1): S36–S45.
Herd Immunity: The Math Behind Protection at Scale
Individual immunity protects individuals. Herd immunity protects everyone, including people who can't be vaccinated — newborns, immunocompromised patients, people with allergies to vaccine components.
The threshold for herd immunity depends on how contagious a disease is, expressed as R0 (the basic reproduction number): the average number of people one infected person will infect in a fully susceptible population.
Herd immunity threshold — the percentage of a population that must be immune (through vaccination or prior infection) to cause the average number of transmissions per infection to fall below 1, causing the pathogen to die out of the population.
The formula is: herd immunity threshold = 1 − (1/R0)
| Disease | R0 Estimate | Herd Immunity Threshold |
|---|---|---|
| Measles | 12–18 | 92–95% |
| Pertussis (whooping cough) | 12–17 | 92–94% |
| COVID-19 (original strain) | 2–3 | 50–67% |
| Mumps | 4–7 | 75–86% |
| Polio | 5–7 | 80–86% |
| Influenza (seasonal) | 2–3 | 33–44% |
Measles sits at the difficult end of this spectrum. Its R0 of around 15 means that roughly 94% of the population must be immune to stop sustained transmission — one of the highest thresholds of any vaccine-preventable disease. A drop below that threshold, even locally, can allow outbreaks to ignite in unvaccinated clusters.
These thresholds assume vaccine efficacy of 100%. When efficacy is less than perfect, the required vaccination coverage increases proportionally. If a disease requires 67% immunity and a vaccine is 90% effective, you must vaccinate 74% of the population (67% ÷ 0.90) to achieve the threshold.
Source: Fine, P. et al. (2011), "'Herd Immunity': A Rough Guide," Clinical Infectious Diseases 52(7): 911–916.
Vaccine Hesitancy: What the Evidence Shows
Vaccine hesitancy — a spectrum from mild concern to outright refusal — is a significant public health issue. Understanding what drives it matters for designing communication strategies.
The 1998 Lancet paper by Andrew Wakefield claiming a link between the MMR vaccine and autism was fraudulent (Wakefield falsified data, lost his medical license, and the paper was fully retracted in 2010) but planted a concern that persisted far beyond the retraction. Dozens of large epidemiological studies since — including a 2019 Danish cohort study of over 650,000 children — have found no association between MMR vaccination and autism.
Wakefield retraction — the 2010 full retraction of a 1998 Lancet paper that falsely suggested an MMR-autism link, following investigation showing Wakefield manipulated data and had undisclosed financial conflicts of interest.
Research identifies several distinct profiles of vaccine-hesitant individuals: those with confidence concerns (doubting safety or efficacy), complacency (low perceived risk of disease), convenience barriers (access, cost), and calculation (weighing risks actively). Each responds differently to evidence and framing. Mandates reduce hesitancy from complacency and convenience; they tend to entrench hesitancy based on confidence concerns.
The COVID-19 pandemic provided an unusual case study. Vaccine rollout was the fastest in history; so was public scrutiny of every adverse event. Myocarditis associated with mRNA vaccines in young males — real but rare (around 4–7 cases per 100,000 doses of the second Pfizer dose in males aged 12–17) and typically mild — became a major driver of hesitancy in that demographic. The evidence consistently showed that COVID-19-associated myocarditis was both more common and more severe than vaccine-associated myocarditis, but risk communication that doesn't acknowledge real-world harms loses credibility.
Source: Madsen, K.M. et al. (2019), "MMR Vaccination and Autism," Annals of Internal Medicine 170(8): 513–520.
The 2026 Pipeline: Cancer Vaccines and Universal Flu
The same mRNA platform that proved itself in COVID-19 is now being applied to diseases where vaccines were previously impossible or impractical.
Personalized Cancer Vaccines
Cancer cells accumulate mutations that produce novel proteins called neoantigens — protein fragments that appear on the cancer cell's surface but not on healthy cells. A personalized cancer vaccine sequences a patient's tumor, identifies its unique neoantigens, designs an mRNA vaccine encoding those specific sequences, and administers it to train cytotoxic T cells to kill any cell displaying those markers.
This is, in effect, a vaccine designed specifically for one person's cancer. Each dose is custom-manufactured.
In 2024 and 2025 trials, personalized mRNA vaccines for melanoma (in combination with pembrolizumab, a checkpoint inhibitor) showed a 44% reduction in recurrence or death compared to pembrolizumab alone in a Phase 2 trial. In 2026, phase 3 trials are underway for melanoma, non-small-cell lung cancer, and bladder cancer.
Perhaps most strikingly, a Phase 1 trial of a personalized mRNA vaccine for pancreatic cancer — historically one of the deadliest cancers, with a five-year survival rate under 12% — showed that nearly 90% of patients whose immune systems responded to the vaccine were still alive up to six years after treatment, according to Memorial Sloan Kettering Cancer Center.
Source: Rojas, L.A. et al. (2023), "Personalized RNA neoantigen vaccines stimulate T cells in pancreatic cancer," Nature 618: 144–150.
Universal Influenza Vaccines
Seasonal flu vaccines must be reformulated annually because influenza virus mutates its surface proteins (hemagglutinin and neuraminidase) rapidly. Researchers have long sought a vaccine that targets conserved regions of the virus — parts that don't change much because they are essential to the virus's function.
A major candidate targets the "stalk" region of hemagglutinin, which is structurally conserved across influenza strains. Several Phase 2 trials of stalk-targeting vaccines are in progress as of 2026. The mRNA platform is particularly suited to this because it can deliver multiple antigen sequences simultaneously, and it can be updated quickly if a pandemic strain emerges.
Source: Nachbagauer, R. & Palese, P. (2020), "Is a Universal Influenza Virus Vaccine Possible?" Annual Review of Medicine 71: 315–327.
What People Get Wrong About How Vaccines Work
A few persistent misconceptions are worth addressing directly.
"Vaccines can cause the disease they protect against." Live-attenuated vaccines contain weakened virus that can occasionally revert (as with the oral polio vaccine, now phased out in most countries for this reason). mRNA vaccines, subunit vaccines, and inactivated vaccines contain no replicating pathogen and cannot cause disease. Symptoms like fever and fatigue after vaccination are signs of immune activation — the vaccine working — not infection.
"Natural immunity is always better than vaccine-induced immunity." For some diseases, natural infection does produce broader immunity than current vaccines. For others, vaccination produces equal or superior protection without the risks of actual disease. For diseases like tetanus, natural infection provides no durable immunity at all — the toxin dose required to cause disease is below the threshold that triggers an immune response. The comparison is disease-specific and rarely as simple as "natural = better."
"Vaccines contain dangerous levels of aluminum." The amount of aluminum in vaccines ranges from roughly 0.125 mg to 0.625 mg per dose. An infant naturally ingests around 7 mg of aluminum from breast milk over the first six months of life; formula-fed infants ingest significantly more. The body processes and excretes aluminum regularly; the quantities in vaccines are pharmacologically trivial.
Source: CDC (2023), "Adjuvants and Vaccines" — Centers for Disease Control and Prevention factsheet on adjuvant safety.
The Takeaway
Vaccines work because the immune system is, at its core, a memory system — and memory can be installed safely, deliberately, and durably. The variation across vaccine platforms is real: live-attenuated vaccines generate the broadest immunity; mRNA vaccines offer unprecedented speed and flexibility. But all of them exploit the same fundamental biology: expose the adaptive immune system to an antigen before the real threat arrives, and it will be ready when it does. The expanding application of this principle to cancer, using tumors' own mutations as targets, represents the most significant extension of vaccine logic since Jenner used cowpox to prevent smallpox in 1796.
Frequently Asked Questions
Q: How do mRNA vaccines work without altering your DNA?
A: mRNA vaccines deliver instructions that ribosomes read in the cell's cytoplasm (outside the nucleus). The mRNA degrades within days, and cells lack the reverse transcriptase enzyme needed to convert RNA into DNA. The genetic information in your nucleus is never accessed or modified.
Q: Why do some vaccines require multiple doses?
A: Some vaccines need two or more doses because a single dose produces a modest primary response; the second dose — encountering memory cells from the first — triggers a much stronger secondary response with higher antibody levels and longer-lasting memory. Boosters are needed when immunity wanes below protective thresholds over time.
Q: What is the difference between vaccine efficacy and vaccine effectiveness?
A: Efficacy measures how well a vaccine works in a controlled clinical trial under ideal conditions. Effectiveness measures how well it works in the real world across a diverse population with variable storage, administration, and health conditions. Effectiveness is almost always somewhat lower than trial efficacy.
Q: Can you get a disease you're vaccinated against?
A: Yes, but the probability and severity are both reduced. No vaccine is 100% effective in every person. Factors like immune status, the specific variant circulating, time since vaccination, and whether boosters have been received all affect protection. Vaccinated individuals who do get infected typically have milder illness.
Q: What does "adjuvant" mean on a vaccine ingredient list?
A: An adjuvant is a compound added to enhance the immune response to the antigen. Aluminum salts (alum) are the most common. They stimulate the innate immune system, which amplifies the adaptive response and leads to higher, more durable antibody levels. They are responsible for much of the injection-site soreness.
Q: How close are we to cancer vaccines actually being available?
A: As of 2026, personalized mRNA cancer vaccines are in Phase 3 clinical trials for melanoma and Phase 2 for pancreatic and lung cancers. Regulatory approval is likely within a few years for at least some indications, starting with melanoma. The main barriers are manufacturing speed (each vaccine must be custom-synthesized for each patient) and cost.
Q: What is herd immunity and why does vaccination coverage matter?
A: Herd immunity occurs when enough people in a population are immune to a pathogen that the chain of transmission breaks — infected individuals encounter immune people and can't pass the disease on. For highly contagious diseases like measles (which requires about 94% immunity), small drops in vaccination coverage can enable outbreaks.
Read next:
Weekly digest
Stay ahead of the curve
Get the best science, AI, and tech stories delivered to your inbox every week. No spam — unsubscribe any time.
About the Author
SciHub101 is an independent science and technology publication founded and edited by Buğra Sözeri, a software engineer and app developer based in Türkiye. Articles are drafted against peer-reviewed literature and primary sources, fact-checked, and edited by a human before publication. Where we compare products, anything built by our own team is labelled as such — see the editorial guidelines and About page for how corrections and disclosures work.
Related Articles

The Science of Sleep: Why You Need It and What Happens
The science of sleep: what happens in each stage of NREM and REM, how your brain clears waste while you sleep, and what chronic deprivation does to your body and mind.

Why Do We Forget Things — The Neuroscience of Forgetting Explained — SciHub101
The neuroscience of forgetting: encoding failure, decay, interference, motivated forgetting, sleep's role in memory consolidation, and why forgetting is adaptive.

How Vaccines Work — The Biology Behind Immunity
Discover the biology behind vaccines: how antigens, B cells, T cells, and memory cells create lasting protection — and why boosters matter.

How Vaccines Work: History and Science
From Jenner's cowpox experiment in 1796 to mRNA cancer vaccines — a complete guide to the history, immunology, and future of vaccination.

The Immune System: How It Works Explained
Explore how the immune system defends your body — from skin barriers to T cells, vaccines, autoimmunity, and cancer immunotherapy.

mRNA Vaccines: How the Technology Works
How mRNA vaccines work — from Karikó's 30-year quest to lipid nanoparticles, COVID-19 success, and cancer vaccine breakthroughs.