There are several types of immunity: Innate vs Adaptive Immunity
There is a lot of confusion about what immunity is and about "natural immunity". We are not born with immunity to all things.
First, we are born with only what is called "natural, or innate" immunity, This type of immunity is what we are born with and is encoded in one's genes.
The second line of defense against non-self pathogens (what we are not born with) is called the adaptive immune response. Adaptive immunity is also referred to as acquired immunity or specific immunity. The adaptive immune response is specific to pathogens that we are introduced to after being born. These are bacteria, viruses, parasites, pollen, dust, and toxic chemicals. Our bodies make proteins called antigens that allow the human body to know that they intend to cause damage to us. The adaptive immune response is meant to attack them but can sometimes make errors and attack itself. When this happens, autoimmune diseases can develop, (like lupus, rheumatoid arthritis, etc).
Then there is the inflammatory response (inflammation) that occurs when tissues are injured by bacteria, trauma, toxins, heat, or any other cause. The damaged cells release certain chemicals. These chemicals cause blood vessels to leak fluid into the tissues, causing swelling. This helps isolate the foreign substance from further contact with body tissues, sometimes making pus.
Allergies are immune system disorders that occur when the immune response is directed against body tissue, or is maybe excessive, or is lacking. Allergies involve an immune response to a substance that most people's bodies perceive as harmless.
Immunizations or vaccinations are a way to trigger the immune response. Small doses of an antigen, such as dead or weakened live viruses, are given to activate the immune system's "memory." Memory allows your body to react quickly and efficiently to future exposures.
Vaccines are needed because humans never built up a "memory" inside our cells against COVID-19. We had never been exposed to it either by our parents, genetically, or until the virus was introduced, so we need outside help. Vaccinations help create immunity.
For more info
– Innate vs Adaptive Immunity https://www.technologynetworks.com/immunology/articles/innate-vs-adaptive-immunity-335116