Vaccination introduces the formation of the antibodies when it is injected into the body of a living organism. These antibodies provide strength to the body to fight against infections.
Vaccine is always done prior to the infection to keep the immune system prepared to fight against infections.
Vaccine is a form of acquired immune system. Hence, the principle of vaccination is to produce immunity against a disease.