Vaccine-related immunity is related to several factors. Among them:
1) The rate of "vaccine escape" of the pathogen - that is, how well new variants of the pathogen can escape recognition by a vaccine. This varies from pathogen to pathogen.
2) The strength of the immune response to the vaccine. For example, live-attenuated vaccines are basically natural infections.
3) Whether or not your immune memory is occasionally boosted by coming into contact with someone who is shedding the pathogen.
All of these vary based on the pathogen and vaccine pairing. And critically, for COVID-19, we don't know several of these parameters.
We aren't entirely certain how long the corona vaccines will be protective.
Part of it is that there's tens of millions of people infected with coronavirus right now, giving it lots of room to mutate. There's maybe a few hundred or a few thousand people infected with polio.
It hasn’t yet been possible to measure if the coronavirus vaccine protects for more than a couple of years. The first human trial subjects only received it 14 months ago.
The old oral polio vaccine (Sabin) didn't provide lifetime immunity like the newer injection. (Reading about the immunities both confer, I'm not clear on the distinction between "gut immunity" preventing asymptomatic shedding, versus "immunity" that prevents the virus from causing serious nervous system disease)