when infected with a new pathogen it take the white blood cells time to produce antibodies
vaccinations involve injecting a small amount of dead or inactive pathogens, these carry antigens, which cause the body to produce antibodies to attack them
if the pathogen enters the body after the vaccination, the white blood cells can quickly mass produce antibodies
the immune system has memory so if the same pathogen enters again, the body will be able to fight off the infection quicker as there are already antibodies present