The third dose triggers your body to make a fresh batch of antibodies. They'll hang around for a few months, and should be able to kill off attempted new infections quickly - ideally before the virus gets chance to spread.
The fact it's the third time your body has seen this infection annoys it, so it makes more antibodies and a broader cocktail of them. The immune system memory (the scientists study these T and B cells as well) gets triggered at the same time and prepares to make new recipes for the next time it happens.
The vaccine trained your body to be ready for the Wuhan virus, it's now got a head start to attack the variants. It was good at stopping Alpha and Delta after two doses, the third made it excellent again.
Now Omicron has shown up. We're expecting the freshly topped up circulating antibody mix to do a good job at stopping it and the memory cells to do an even better one at concocting new recipes to get rid of it before it gets severe.
Dose 2 was the, "I've told you before, just clear off" jab. What we hope dose 3 does is add the phrase, "and take your scummy mates with you."
With apologies to any doctors, virologists and immunologists etc who stumble across this...