Herd immunity occurs when a significant portion of the population becomes immune to a disease, making its spread unlikely. This form of indirect protection is crucial for safeguarding individuals who are immunocompromised or allergic to certain vaccines. Herd immunity helps to control and eventually eradicate diseases, as seen with smallpox.