Vaccines can last your entire lifetime, but their effectiveness decays over time it largely depends on the disease and your risk of infection. Booster shots for various vaccines have been common for example, it’s recommended people take a Tdap booster every 10 years, Tetanus every 4-6 etc.
The flu vaccine is a special case as it’s changed every year.
In the original use of the vaccina virus against variola (smallpox) infection, symptomatic smallpox could present after vaccina exposoure of at least five years past.
"Smallpox vaccination provides a high level of immunity for three to five years and decreasing immunity thereafter. If a person is vaccinated again later, the immunity lasts even longer. Studies of smallpox cases in Europe in the 1950s and 1960s demonstrated that the fatality rate among persons vaccinated less than 10 years before exposure was 1.3 percent; it was 7 percent among those vaccinated 11 to 20 years prior, and 11 percent among those vaccinated 20 or more years before infection. By contrast, 52 percent of unvaccinated persons died."
> Is it not just timing? I thought the effectiveness of the vaccines only lasted around 6 months
No, it is not (just) timing.
"Three doses gives better protection than two doses ever did" (1)
Immune response is very complex (2) and we're not experts; but we should not measure it in just 1 number: that gives the impression that the response is a range from "high alert for this recent threat" through to "threat forgotten" - effectiveness did not last that long.
There are there are other states as well when the threat is "on file" in the immune memory. Another exposure months later influences this process. My guess is that the evolved heuristic is that "a threat that recurs more is worth remembering better".
My understanding is that they've studied people with 2 vs. 3 shots, both groups having received their most recent shot in a similar timeframe to account for that.