When you are vaccinated, you primarily protect yourself (individual protection). Nevertheless, there are groups of people in a society who cannot have themselves vaccinated. These are e. g. Sick, infants, the elderly, people with certain allergies, etc. In addition, there are people for whom vaccination is not effective (so-called non-responders). These people together do not have sufficient vaccination protection and are helplessly at the mercy of the sometimes very dangerous pathogens. Nevertheless, there is a certain vaccination rate for each pathogen, which is referred to as herd immunity. If the vaccination rate in a society exceeds this threshold, pathogens cannot spread and therefore do not reach the unvaccinated individuals in society, who are usually much more susceptible to complications of disease than healthy individuals.
The vaccination rate, from which one speaks of a herd immunity, is located between 83-94% (depending on the aggressiveness of the pathogen) specific to the pathogen. Current measles cases in the USA and Germany show what can happen if this rate is not reached. As a reminder: Measles should be exterminated long ago (especially in Europe) and can lead to brain and pneumonia, deafness and death.