Herd immunity (or community immunity) describes a form of immunity that occurs when the vaccination of a significant portion of a population (or herd) provides a measure of protection for individuals who have not developed immunity. Herd immunity theory proposes that, in contagious diseases that are transmitted from individual to individual, chains of infection are likely to be disrupted when large numbers of a population are immune or less susceptible to the disease. The greater the proportion of individuals who are resistant, the smaller the probability that a susceptible individual will come into contact with an infectious individual.
Vaccination acts as a sort of firebreak or firewall in the spread of the disease, slowing or preventing further transmission of the disease to others. Unvaccinated individuals are indirectly protected by vaccinated individuals, as the latter will not contract and transmit the disease between infected and susceptible individuals. Hence, a public health policy of herd immunity may be used to reduce spread of an illness and provide a level of protection to a vulnerable, unvaccinated subgroup.
National Institute of Allergy and Infectious Diseases & Wikipedia