How does a vaccine provide immunity?
vaccine contain the same germs as the disease but they are weakened. So when they are injected into the body you won't get really sick. But next time you get the disease your immune system recognizes it and responds to kill it.