Vaccines allow your immune system to recognize specific germs so you can better react to them in the future.
One way to think of your immune system is as a standing army of fighter cells, ready to go into battle. Just as soldiers perform different functions, so do the cells in your immune system. Some, such as T cells and B cells, are key players in your immune system army. Once they kill off an invader, some of them are converted into memory cells. These memory cells will stay on the alert for years, patrolling your body for invaders. If they encounter that invader again, your body is more prepared to fight it off.8, 9