Answer:
The wonders of the immune system. When an agent (vaccine or natural exposure) is introduced into the body antigens are activated. When they activate antibodies are then created to lock in on the virus to destroy it. Some vaccines do not offer 100% protection. A vaccine can either be live or killed. A rabies vaccine for example is a killed vaccine. After a virus whether natural or vaccinated is encountered the immune system makes memory cells that remember how to destroy the virus. When the virus is introduced at a later date the memory cells activate and kill off the virus before any symptoms of illness are seen.