Herd immunity occurs when a large portion of the community becomes immune to a disease, making its spread unlikely. This is particularly important for protecting those who cannot be vaccinated, such as newborns or individuals with certain health conditions.