How do vaccines work? An expert explains

What happens after you receive a vaccine? And how can something so simple have such a lasting impact on your health? Infectious disease expert Matthew Miller explains how it works.

By Blake Dillon February 23, 2026

A smiling woman with short white hair shows off a bandaid on her upper arm.
Vaccines provide your body with a crash course on what to do during times of actual emergency

Expert Featured In This Story

Matthew S Miller
Matthew S Miller

Professor

See Profile

How do vaccines work?

A quick doctor’s visit, a poke in the arm, and — just weeks later — you’ve gained powerful immunity to some of the world’s most deadly diseases. But what’s really going on inside you after you receive a vaccine? And how can something so simple have such a lasting impact on your health?

The answer lies in your immune system, says Matthew Miller, director of NexusHealth and the Michael G. DeGroote Institute for Infectious Disease Research at McMaster University.

“Virtually everywhere inside us are specialized immune cells called antigen-presenting cells, which detect threats and bring suspicious material — or antigens — to the lymph nodes,” he explains.

“There, other immune cells called B-cells and T-cells evaluate the evidence, and those that recognize that specific threat spring into action and conduct a coordinated immune response.”

Over time, these antigen-specific immune cells will multiply, refine their infection-detecting and eliminating skills, and persist in your body, so that the next time similar antigens are found, they can act more swiftly and decisively.

That’s why you only get some infections once — like chickenpox. It’s not that you never encounter the virus again, it’s that your B-cells and T-cells have become experts at neutralizing it before an infection can happen.

Other pathogens, like the viruses that cause influenza and COVID-19, can mutate in ways that help it evade your immune cells, which is why seasonal infections can occur.

But what happens if you’re exposed to a pathogen with antigens that your B-cells and T-cells have never seen before?

In these cases, your immune system must train itself to recognize the invader after it has already started to attack your body.

“This response doesn’t happen overnight,” explains Miller, a professor of Biochemistry and Biomedical Sciences.

“While your immune system is strategizing how best to respond, the pathogen has an opportunity to replicate and spread unchecked. This can make you very sick and can even be fatal.”

But this is where vaccines come in.

Most vaccines contain antigens — weakened or inactivated versions of a pathogen, or highly purified components of the pathogen that the immune system can recognize and target. Others provide genetic instructions that prompt your own cells to produce specific antigens.

In every case, this antigenic material is recognized, analyzed, and remembered by your immune system — much like it would be during an infection.

But instead of needing to become sick first to build immunity, vaccines provide your body with a crash course on what to do during times of actual emergency.

“By training the immune system in advance of natural exposure to a pathogen, vaccines transform a potentially dangerous first encounter into a manageable situation,” Miller says. “They prepare the body to recognize and stop harmful pathogens before serious illness can occur.”

Learn more in the animated video, This is How Vaccines Work.

Marek Smieja smiles while standing outside on a bright day.

McMaster scientist Marek Smieja receives prestigious national award for infectious disease research 

The John G. FitzGerald Award recognizes Smieja for advancing the diagnosis and epidemiology of respiratory and gastrointestinal infections, including those caused by SARS-CoV-2, influenza, rhinovirus, and C. difficile.
Toronto skyline enveloped in yellowish smog.

Everyday air pollution linked to poorer brain function, study finds

New research suggests that fine particles from traffic, industry and wildfire smoke are linked to worse cognitive function.
Smiling Sheila Singh wearing a McMaster lab coat, looking over lab equipment.

New McMaster-made drug candidate shows promise as a brain cancer treatment 

The drug candidate can eliminate deadly and aggressive glioblastoma tumours, which typically resist standard treatments and often recur rapidly.