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 couple walking on a path, one of them using a walker for assistance.

McMaster researchers identify genetic factors linked to frailty

Understanding what influences frailty opens the door to earlier screening and personalized approaches to supporting healthy aging, researchers say
A close-up of a vial containing a clear peptide blend of BPC-157 and TB-500, next to two single-use syringes.

What do we know about ‘research only’ peptides? Q&A with expert Stuart Phillips 

Unapproved peptides that lack safety and efficacy data carry substantial risks and belong in a laboratory, not your body, Phillips warns.
Scientist Jon Stokes stands in a university corridor, wearing a hoodie and ball cap.

McMaster researcher awarded more than $2M from Weston Family Foundation to advance precision antibiotic for IBD

The funding will accelerate the move toward human trials, enabling preclinical studies, regulatory preparation and early-phase clinical trial design.