I'm a bit confused by the term "infection" here.
Let me split some hairs:
Vaccines work by teaching the immune system how to fight an intruding virus, so it doesn't have to spend days or weeks figuring it out while the virus destroys your body.
That means vaccinated people get viruses as often as unvaccinated, but defeat it much faster, usually before you notice any symptoms.
My confusion is that I would call the time my immune system spends fighting a virus in my body an "infection", but apparently that is not the established use.