The first time you get sick with a virus can affect how your body responds to that virus for the rest of your life.

Memory B cells are a most remarkable part of the immune system. When the body encounters a viral infection, it produces antibodies to counteract that virus. Pretty soon (hopefully!) the virus has been purged. But the body still remembers how to fight that particular virus, in case an infection should return. The memory B cells are the ones that remember.
Those memory B cells float around inside you, sometimes for decades, just waiting for the virus to return. If it does, then the cells jump into action and produce a very rapid immune response. This is why vaccines work, and why you don’t tend to get sick with the exact same virus more than once. But this immunological memory also has a downside. It’s not great at adjusting to change.
By change I mean virus mutation – antigenic shift. As we have seen over the last couple of years of the Covid-19 pandemic, new strains with new antigens can emerge. When they do, they still trigger the same memory B cells. The body rushes out production of antibodies to fight the virus… but it’s producing a response to the original virus rather than the mutation. And, because the immune response is targeting an older version, it’s not as effective at fighting the new one.
When this phenomenon was first identified in the mid-20th-century, it was likened to the Christian concept of original sin. Our first contact with the virus affects all our other responses to the virus:
The antibody of childhood is largely a response to dominant antigen of the virus causing the first type A influenza infection of the lifetime. […] The imprint established by the original virus infection governs the antibody response thereafter. This we have called the Doctrine of the Original Antigenic Sin
Original antigenic sin
Now, I’ve seen a few people online using this concept to argue against Covid-19 vaccination – that it would cause problems defending against later virus variants. Fortunately, there’s no evidence that this is a problem for Covid-19 specifically:
It can be concluded that phenomena such as OAS and ADE, based on theoretical grounds and well as outcome of experimental animal studies could have been stumbling blocks for the development of SARS-CoV-2 vaccines. In practice, current mRNA and as well as the adenovirus vectored vaccines appear to be safe and effective, with no signs of OAS or ADE.
The “original antigenic sin” and its relevance for SARS-CoV-2 (COVID-19) vaccination
B cells (generated by the vaccines) adapt the new antibodies they produce to work against variants. Therefore, the protection conferred by the vaccines against severe disease (but not mild breakthrough infections, even with the booster) seems to be holding up very well.
Risk and Reward: Vaccine Experts on Boosters, Myocarditis, Omicron, and More