Vaccines work to prime your immune system against future “attacks” by a particular disease. There are vaccines against both viral and bacterial pathogens, or disease-causing agents.
When a pathogen enters your body, your immune system generates antibodies to try to fight it off. Depending on the strength of your immune response and how effectively the antibodies fight off the pathogen, you may or may not get sick.
If you do fall ill, however, some of the antibodies that are created will remain in your body playing watchdog after you’re no longer sick. If you’re exposed to the same pathogen in the future, the antibodies will ”recognize” it and fight it off.
Vaccines work because of this function of the immune system. They’re made from a killed, weakened, or partial version of a pathogen. When you get a vaccine, whatever version of the pathogen it contains isn’t strong or plentiful enough to make you sick, but it’s enough for your immune system to generate antibodies against it. As a result, you gain future immunity against the disease without having gotten sick: if you’re exposed to the pathogen again, your immune system will recognize it and be able to fight it off.
Some vaccines against bacteria are made with a form of the bacteria itself. In other cases, they may be made with a modified form of a toxin generated by the bacteria. Tetanus, for example, is not directly caused by the Clostridium tetani bacteria. Instead, its symptoms are primarily caused by tetanospasmin, a toxin generated by that bacterium. Some bacterial vaccines are therefore made with a weakened or inactivated version of the toxin that actually produces symptoms of illness. This weakened or inactivated toxin is called a toxoid. A tetanus immunization, for example, is made with tetanospasmin toxoid.