Immunisation protects a person from a disease before they catch it. A vaccine contains an inactive form of a pathogen, for example a dead or weakened one. It cannot cause the disease, but it still has antigens on its surface. The antigens trigger lymphocytes to make antibodies, and some lymphocytes become memory lymphocytes.
If the real pathogen enters the body later, the memory lymphocytes give a fast secondary response, so the person does not become ill. The person is now immune to that disease.
Immunisation has advantages and disadvantages. It can prevent epidemics and protects the person who is vaccinated. When most people in a population are immunised, the pathogen cannot spread easily, which also protects people who are not immunised, such as babies. This is herd immunity. A disadvantage is that some people get side effects such as a sore arm or a fever, and a vaccine does not always give protection to everyone.