The vaccine functions like the disease
1
Vaccines consist of dead or living portions of a virus or bacterium, so the body is subjected to the same microorganism as with natural infection.
2
The immune system reacts by developing antibodies, which combat the disease, and memory cells, that remember it for next time.
3
When the body encounters the same virus or bacterium again, the immune system identifies it, producing the right antibodies.