Vaccines do provide immunity and can be used to achieve herd immunity
Herd immunity occurs when a significant portion of a population is immune to a pathogen, making it difficult for the pathogen to spread through the population. Apart from protecting vaccinated individuals, herd immunity provides indirect protection from infection even to individuals who are unable to be vaccinated. One strategy to achieve herd immunity is through vaccination, which provides protective immunity to vaccinated individuals.