In a vaccination there are small quantities of a dead or inactive version of the pathogen.When you inject it into the individual's body an immune response is stimulated against the 'foreign body'. The white blood cells multiply in number and produce lots of antibodies which are specific and complementary to the pathogen. This is called the primary immune response and it creates memory cells. If the pathogen enters the individual's body again the immune system recognises it and quickly produces the correct antibodies so that the pathogen is removed before the individual shows any symptoms, avoiding illness.If enough of the population is vaccinated against a certain pathogen herd immunity is achieved because so many people are protected against it, it is unlikely the pathogen will enter a person who has not been immunised.Very few people will be able to pass the pathogen onto others, preventing the spread of the pathogen, therefore protecting the population as a whole.