Several factors can contribute.
1. Immunity changes over time
Protection is not necessarily permanent.
The WHO reports that protection against severe disease and death is highest in the first few months following vaccination and subsequently decreases.
This does not mean protection suddenly disappears.
It means the level of protection can gradually decline.
That is why vaccination recommendations can change as scientists collect additional evidence.
2. The virus changes
SARS-CoV-2 has produced multiple variants over the course of the pandemic.
Some variants have been able to spread more efficiently or partially evade existing immunity.
The WHO notes that viruses can change over time and that emerging variants can affect vaccine protection against infection.
This is one reason updated vaccines have been developed.
3. No vaccine is 100% effective
This is not unique to COVID-19.
The WHO emphasizes that no COVID-19 vaccine provides 100% protection against infection.
So a person can follow vaccination recommendations and still become infected.