Why would anybody get vaccinated?

Smallpox deaths in Sweden 1749-1900

As you can clearly see from these statistics, the smallpox vaccination did not work: It did not end the frequent epidemics that swept through Sweden (and all other countries for that matter). The epidemics continued for more than 100 years despite the vaccination!* The vaccination was introduced more than 200 years ago in England. The figures are from Sweden because they were one of the few countries that early on kept relatively good statistics.
In typical smallpox epidemics, 10-20% of the infected people died. In populations that had not been selected for resistance by frequent epidemic waves, the death rates could rise up to 70%. So why would anybody get vaccinated? With the last smallpox-infected human dying or recovering, the virus would go extinct, and humankind managed to eradicate smallpox this fashion. We got close to the same goal with polio but did not reach it (yet). Despite the differences between polio, smallpox, and SARS-CoV2, the graph seem to indicate that we are in for the long haul.

*Note added for those living in an alternative reality: These sentences contain irony!