The entire point is that a smallpox vaccine does provide genuine immunity from smallpox to the point that was so apparent that we could casually observe even the tiniest micro-population (milkmaids) were somehow just completely immune. They didn't get it, they didn't spread it, and their immunity didn't just disappear in a few months or because of a slight genetic variation.
And, also critically, there is no non-human transmission vector for smallpox. It travels exclusively between humans, contrasted against COVID which thrives in both human and animal populations. So if you were unvaccinated and spent all your time around milkmaids - you would not become infected, because there was no vector for the disease to get to you. If 90% of your company were milkmaids, you may get it if one of the other unvaccinated was infected, but the odds would be reduced. This is what herd immunity refers to.
You can observe the effects of 'herd immunity' with the current COVID vaccines in places such as Gibraltar. They achieved greater than 100% vaccination rates, and early on, by vaccinating not only their entire population, but even a large number of migrant workers. They ended up with a death rate of 3,204 per million contrasted against 3,266 for the US. And their infection rate was one of the highest in the world at nearly 60%, but that was probably more so due to extensive testing than greater susceptibility.