When a vaccine is given, it introduces a harmless form or part of a germ into the body. This stimulates the immune system to produce antibodies and memory cells. If the vaccinated person is later exposed to the real disease, the immune system can respond quickly and prevent serious illness.