Here is a really good explanation of immunity for COVID-19 as generated by vaccination and infection. Bonnie explains the processes really well with citations to the research. It's about 20 minutes long, and well worth the time.