Pathogens are microbes that cause diseases. Vaccines allow a dead or altered form of the disease causing pathogen to be introduced into the body without causing the disease. The pathogens that are introduced contain a specific antigen. The antigen causes the body's immune system, specifically the lymphocytes, to produce complementary antibodies, which target and attach to the antigen.
During a primary infection levels of antibodies slowly increase, peak at around ten days and then gradually decrease. This is what happens when someone is vaccinated with a dead or inactive pathogen or when someone catches a disease for the very first time. It is called the primary immune response.
A second exposure to the antigen that was in the vaccine, or to the same pathogen that made the person ill before, causes the white blood cells to respond much more quickly this time. This is the secondary immune response. The antibodies are produced so quickly by the memory cells that the pathogen is killed off before it can make the person ill. This is called being immune to a disease or having immunity.