Your body has two types of immune response, one called an innate immunity, which basically is programmed to attack certain types of pathogens at birth, and another an adaptive or acquired immunity. Vaccines target the adaptive immunity.

If we only had an innate immunity, viruses and other pathogens would learn to bypass it by hiding or disguising themselves in various ways. In order to counter this, our bodies constantly learn to recognize new pathogens. This is done by breaking down viruses into protein parts called antigens and creating antibodies that bind to those parts. Think of it like a lock and key.

Viruses typically have many proteins that can serve as these antigens on the surface of their cells. Many of these protein structures are actually used by the virus to bind to cells in our body and enter them.

Once antibodies to those antigens are being produced, they’re able to lock onto those surface structures and interfere with a viruses ability to function.

So a vaccine is simply a way to introduce those antigens and surface binding proteins in order to cause your body to generate an antibody immune response.

Another key component is that once your immune system creates antibodies, it “remembers” them through certain memory cells that are able to quickly produce the same antibody when needed at a later date.

Now all that sounds pretty simple, but the details get complicated, which is why vaccine effectiveness varies. Oftentimes certain types of viruses change their outer proteins so often, that a vaccine targeting one strain produces an immune memory that doesn’t work well with the next mutation.

Or other times the antibodies only bind to certain proteins that only partially interfere with virus infection. Or in some cases the way the vaccine is produced means that the antigens change subtly during the process making them less potent for good antibodies.

These new COVID vaccines are actually a method if introducing specific and accurate antigens to our immune system in a novel way. In this case it’s a bit of RNA that causes our cells to generate the antigen proteins themselves. It has the promise of being able to produce antigens of greater number and specificity than other methods. It’s basically using the same process as many viruses themselves (rna getting our cells to produce proteins) meaning our immune system is primed to take advantage and produce stronger immunity.

So the short answer is these vaccines are likely to produce strong and lasting immunity to the coronavirus they are targeting. What is unclear however is how fast this new strain of coronavirus will mutate into strains requiring more yearly shots to deal with changing antigen profiles (like the annual flu).

So the unknown is simply how this virus will evolve... if we’re lucky mutations that significantly change the surface antigens targeted by these vaccines will also mean the virus either becomes less contagious or less deadly.

If you’re truly interested I highly recommend this book on how the immune system works, full of excellent sources.

https://www.amazon.com/Elegant-Defense-Extraordinary-Science...

More technical information on Wikipedia’s immunity sections:

https://en.m.wikipedia.org/wiki/Adaptive_immune_system

https://en.m.wikipedia.org/wiki/Antigen

https://en.m.wikipedia.org/wiki/Antibody

https://en.m.wikipedia.org/wiki/Vaccine