Vaccines introduce a dead, inactive or altered form of a pathogen (a microbe that causes an infectious disease) into the body. These pathogens have antigens, which have a shape specific to that pathogen. The white blood cells (the main cells of the immune system) then create antibodies with a complimentary shape to those antigens, which help the white cells kill off the pathogen by attacking the antigen. Then, if the body is infected by the live version of the same pathogen, the white blood cells can respond more rapidly and produce the same antibodies, so you are protected from that disease.