If an infected person has few susceptible contacts, the infection is less likely to spread through the population. Herd immunity applies mainly to diseases passed person-to-person.
where (R_0) is the average number of people one infectious person would infect in a fully susceptible population.
Vaccination is the safer way to achieve population immunity because acquiring immunity through natural infection can cause severe illness, disability, and death. The
WHO explanation of vaccination describes vaccination as a safe way to build immune protection before exposure.