Vaccines work through an ‘expose-response’ mechanism. Vaccination trains cells in the body’s immune system to recognise and respond to an infection. We train the immune system by exposing – vaccinating – it to molecules (antigens) from a virus or bacteria.
These molecules are either parts of the pathogen or an inactivated version of the pathogen, (which means its unable to infect but still capable of triggering an immune response.
This immune response is created without you getting as sick as you would if you were infected with the pathogen from the environment, which is known as a ‘wild-type’ infection. Some of these immune system cells have long memories and the next time the body ‘sees’ the same or a similar threat, the immune response is repeated and the infection is prevented from progressing to disease.
Read more here.