Definition
Immunity is the body's defense system for recognizing and stopping invaders. It combines defenses you're born with, like skin and mucous membranes, and defenses that remember an enemy you've already met and respond faster the next time. That's why, with many illnesses, meeting the same germ a second time gets sorted out much faster than the first. But sometimes a record exists and still doesn't work well enough, so you can get the same illness again.
Why do you get measles once, but catch colds year after year?
If you had measles as a kid, you rarely get knocked flat by it again as an adult. But a cold? You caught one last year, you catch one this year, and you'll catch one next year. Same body, very different results.
The difference is in what your body wrote down. While you fight measles, your body studies the invader's outer look closely and leaves a record, like a note in a pocket notebook. So when the same germ comes back, your body doesn't waste time figuring out who it is.
Colds are caused by a huge number of different invaders. More than two hundred different germs can give you a cold, so last year's visitor and this year's visitor are different from the start. Your body has to size up a stranger all over again. It's not that you have no notebook. A visitor who isn't in your notebook just showed up. Some germs, like the flu, change their look a little every year, so last year's record doesn't quite match. That's a different reason.
This ability to recognize an enemy you've met before is the heart of immunity. You're not suddenly tougher all over. The second round is milder because a record is still there.
Defenses you're born with and defenses you learn
Your body's defense has two layers. The first layer is there from birth. Skin and mucous membranes form a physical barrier, mucus and saliva wash invaders away, and wandering cells swallow strangers whole. Because you're born with this layer, it's called innate immunity. It doesn't pick its targets much and reacts right away in much the same way every time.
The second layer learns as it goes. It picks out a specific marker on the surface of an invader and builds a new response that fits only that marker. It takes a few days to get going, but it's far more precise, and when the fight is over, cells that remember that marker stay behind. This is where a new line gets written in the notebook. This layer is called adaptive immunity.
This is a little different from the everyday word "immune strength." Immunity refers to the whole system, with its many barriers and cells working together. "Immune strength" talks about that system as if it were a single dial. But the system has more than one dial, so it's hard to call it simply good or bad.
A little more precisely
What's left after you recover from measles isn't a generally tougher body. It's memory cells that fit only that invader's marker. That's why having had measles doesn't make colds or other illnesses any milder.
Records build up separately for each invader, and they can fade over time. Some last a very long time, and some fade fairly quickly. How well a record works also differs from illness to illness. Some, like measles, are nearly done after one round. With others, you can get sick again even though a record exists. It varies by illness and by person, so you can't sum it up with a single number.
It also helps to separate talking about one person from talking about a group. Immunity is the state of one person's body. Herd immunity is when enough people are immune that it becomes hard for the illness to keep spreading through the group.
The notebook analogy works up to a point. In both cases you write down an enemy you've met and pull it out again later. But ink in a notebook stays as it is once written, while your body's record lasts as long as those cells stay alive, and it can fade as the years go by.
Common misconceptions
The higher your immune strength, the better it is for your body.
Immunity isn't a single dial you turn up or down. It's a system of many parts in balance. When the response goes too far, your body can overreact to harmless things like dust or pollen, or even attack itself.
Getting over one illness makes you stronger against other illnesses too.
The learned defense keeps a separate record for each invader. The record from measles is tuned to measles' marker, so it does almost nothing against a completely different invader. You have to build a new record for that one. That said, a record can partly work between very close relatives among germs.
Where you meet it
Someone who has had measles once rarely gets knocked flat by it again, even as an adult.
When dust you breathe in sticks to mucus and gets pushed out of your nose, that's your built-in defense at work.
In one sentence
Immunity is the defense system that stops invaders that get into your body. On top of the defenses you're born with, it records the markers of invaders you've met, so it can respond faster and more precisely when they return.