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.

A person in fitness clothes squats while holding a heavy weight.

Analysis: The tryptophan switch? Why exercise boosts your mood

A single session of working out has been found to cause immediate increases in brain-protective molecules and improvment in mood across age groups.
Two pages from a zine. Text on the left page reads:

Safer drug use site for women and gender-diverse people saves lives 

The key is wraparound supports for overall health and well-being, such as addiction counselling, peer support, legal services, hygiene and reproductive health supplies and housing services. 
From left: Jana Radosavljevic, Ebonee Lennord, and Zeinab Hosseinidoust

How McMaster research supports gender equity

From tackling systemic barriers in health care to developing real-world solutions to everyday needs, here are some of the ways researchers at McMaster are driving change around the world.