Covid has 3 protein markers. After you get infected your antibodies will continue to recognise all three.
However the vaccines don't have all three, so the antibodies generated are not as all encompassing as they would be if you contracted Covid.
Therefore, if it doesn't kill you, having Covid puts you in a better position to fight off variants.
At least that's how I understand it from all the articles I read about the various vaccines, that said, IANAD, so don't take this post as medical advice.