Do you ever remember tasting something or smelling something that takes you back to a childhood memory?
Perhaps it was a tune you heard, and you recognise it from the past. Well, when you were first exposed to it, your brain chose to store a memory of the taste/smell/sound.
Well it’s not just your brain that remembers stuff. Your immune system does too. Special White Blood Cells (leukocytes) called lymphocytes have an incredible capacity to remember chemicals that they’ve been previously exposed to. Every living and even non living thing is made up of matter that is unique to itself.
Think of an orange - it looks and tastes and smells like an orange. An apple looks and tastes and smells like an apple. To your lymphocytes, they remember how a bacteria, virus, or parasite/fungus/allergen smell/taste. On the surface of these organisms, proteins or sugars are present which act as a unique fingerprint called an Antigen. Once your immune cells have been exposed to an antigen, your lymphocytes remember it for a while. Lymphocytes that are born and mature in the bone marrow are called B Cells. They remember the antigens and produce memory jogger chemicals called Immunoglobulins (we commonly call these Antibodies).
Now floating around your blood stream are these Antibodies, and as soon as that virus, or bacteria or threatening allergy producing thing comes into contact with your body again, your immune system can remember it; remember what a threat it was, attack the invader to protect you.
This is happening every minute of every day. Constant surveillance and defence. Some diseases are so dangerous (measles, flu, polio, tetanus (the list goes on)), that it isn’t safe to allow ourselves to be exposed to it. Your lymphocytes must have first come into contact with the disease before it can make those memory jogging Antibodies. So vaccination is the strategy.
When vaccination occurs a tiny dead (in the case of bacteria), attenuated (weakened) or inactive virus sample is introduced into the body, stimulating your lymphocytes to learn to recognise it, and make those memory jogging Antibodies. Now the immune system has been exposed, so should you come into contact with the wild live/active disease, your immune system can whoop it back to primordia.
Memories fade, and so do some antibodies, which is why some diseases need booster shots to remind the immune system what to be vigilant for.
Some organisms mutate so rapidly that they change their antigen. Kind of like getting a fake ID. So for diseases like these (Influenza is a great example) we often need an annual immunisation.
Hope this was in some way helpful. Get your shots!