Vaccination, like you said, stimulates long term protective immunity against a pathogen. So when this immunised individual do get the pathogen, the immune system will quickly destroy it, therefore, preventing further spreading of this pathogen to other healthy individual.
That is why the...