How the Immune System Works
Every day your body fights off germs you never notice. Learn who does the fighting, why you get a fever, how your body remembers a germ for years, and how vaccines teach it all ahead of time. Then step through an infection day by day.
Three layers of defense
Your immune system is not one organ. It's a team of barriers, cells and proteins spread all over your body, in your blood, skin, gut, bone marrow, lymph nodes, spleen and thymus. Its job is to tell “self” (your own cells) from “not self” (germs, toxins, a splinter) and get rid of what doesn't belong.
It works in layers, like a castle with a wall, guards at the gate, and a special forces unit.
| Layer | What it is | Speed |
|---|---|---|
| 1. Barriers | Skin, mucus, tears, stomach acid, coughing and sneezing | Always on |
| 2. Innate immunity | White blood cells and proteins that attack anything foreign, the same way every time | Minutes to hours |
| 3. Adaptive immunity | B cells and T cells that target one specific germ, and remember it | Days the first time, faster after that |
A few words you'll see a lot:
- Pathogen: a germ that can make you sick, like a virus, bacterium, fungus or parasite.
- Antigen: a marker the immune system can recognize, usually a protein on the surface of a germ. Think of it as the germ's “name tag.”
- White blood cells (leukocytes): the immune system's cells. They're made in your bone marrow and travel in your blood and lymph.
Innate vs adaptive in one line. You're born with innate immunity, and it reacts to anything suspicious. Adaptive immunity is learned. It builds a custom response to each new germ and keeps a memory of it.
The first responders
When a germ gets past your skin, through a cut or the lining of your nose, innate immune cells arrive within minutes to hours. They don't need to have seen this germ before.
Neutrophils
The most common white blood cell. They rush in first and swallow bacteria. Pus is largely dead neutrophils and debris.
Macrophages
“Big eaters” that live in your tissues. They engulf germs and dead cells and send out chemical signals that call for help.
Dendritic cells
They grab pieces of a germ and carry them to the nearest lymph node, where they show them to B and T cells. This is the bridge to adaptive immunity.
Natural killer cells
They spot your own cells that are infected by a virus or turning cancerous, and kill them before the problem spreads.
Cells that eat germs are called phagocytes (“eating cells”). Helping them is a set of blood proteins called complement, which coat germs so they're easier to eat and can punch holes in some bacteria.
Why swollen glands? Lymph nodes are the meeting points where immune cells trade information. When they're busy fighting an infection nearby, they fill with cells and swell. That's why your neck glands get tender with a sore throat.
Inflammation and fever
Feeling sick is often your immune system working. Two of the biggest signs are inflammation and fever.
Inflammation: the redness and swelling
When tissue is hurt or infected, damaged cells release chemicals such as histamine. Nearby blood vessels widen and leak fluid. That brings more blood and immune cells to the spot, and walls off the problem. You notice the classic signs:
- Redness and heat from extra blood flow
- Swelling from leaked fluid
- Pain from pressure and chemical signals, which tells you to protect the area
Fever: turning up the heat
Immune cells release signaling chemicals that tell your brain to raise your body's set point. You feel chills and shiver while your body warms up. MedlinePlus calls fever “an important part of the body's defense against infection,” because most germs that infect people grow best around normal body temperature, 98.6°F (37°C).
- 100.4°F (38°C) or higher, taken in the bottom (rectal)
- 99.5°F (37.5°C) or higher, taken in the mouth
- 99°F (37.2°C) or higher, taken under the arm
When to call a doctor right away (from MedlinePlus): a baby 3 months or younger with a rectal temperature of 100.4°F (38°C) or higher; a baby 3 to 12 months with a fever of 102.2°F (39°C) or higher; a child 2 or younger with a fever lasting more than 24 to 48 hours; an adult with a fever of 105°F (40.6°C) or higher (unless it comes down with treatment and you're comfortable), one that stays at or above 103°F (39.4°C), or one lasting more than 48 to 72 hours. Get emergency care for a fever with a stiff neck, confusion, trouble breathing or a seizure.
The specialists: B cells, antibodies and T cells
Adaptive immunity uses two kinds of white blood cells called lymphocytes: B cells and T cells. Your body makes millions of different ones, and each recognizes just one antigen shape. When a dendritic cell shows up in a lymph node carrying a germ's antigen, the few B and T cells that match it get switched on and start copying themselves by the thousands.
Helper T cells
The “generals.” They recognize the antigen and release signals that activate B cells and killer T cells. HIV damages these cells, which is why it weakens the whole immune system.
Killer T cells
Also called cytotoxic T cells. They find your own cells that a virus has taken over and destroy them, stopping the virus from making more copies.
B cells and plasma cells
Activated B cells turn into plasma cells, tiny factories that pour out antibodies into your blood.
Antibodies
Y-shaped proteins that lock onto one antigen. They block germs from entering cells, clump them together, and flag them for phagocytes to eat.
Lock and key. An antibody fits its antigen like a key in a lock. Antibodies against measles do nothing against the flu. That's why the adaptive system is called specific, and why it takes several days to find and grow the right cells the first time.
Round 1 of 8 · Score 0
Memory: why you rarely catch some things twice
After an infection is beaten, most of the extra B and T cells die off. But some stay behind as memory cells. They can live for years, sometimes for life, and they recognize the germ the moment it shows up again.
Primary response
Slow. It takes days to find and grow the right cells, so the germ has time to multiply and you usually feel sick.
Secondary response
Fast and strong. Memory cells jump into action and antibody levels climb higher and quicker. Often the germ is gone before you feel anything.
So why can you catch a cold or the flu again and again? Because there are many different cold viruses, and flu viruses keep changing their antigens a little each year. Your memory cells are watching for the old “name tag,” and the new version looks different enough to slip by. That's why the flu vaccine is updated every year.
A simplified picture for learning, not real patient data. Real timing depends on the germ and the person.
How vaccines train your immune system
A vaccine is a practice run. It shows your immune system an antigen from a germ, without making you sick with the disease. Your B and T cells respond, and you end up with memory cells. If you meet the real germ later, you get the fast secondary response from lesson 5 instead of the slow first one.
The CDC explains it this way: vaccines imitate an infection to engage the body's natural defenses. Protection takes time. Immunity can take weeks to build after a shot, so you can still get sick in that window.
| Vaccine type | What it uses | Examples |
|---|---|---|
| Live-attenuated | A weakened form of the germ | MMR, chickenpox, rotavirus |
| Inactivated | A killed version of the germ | Polio shot, hepatitis A, rabies |
| Subunit, recombinant, conjugate | Just a piece, like a protein or sugar from its surface | Hepatitis B, HPV, shingles, whooping cough |
| Toxoid | An inactivated toxin the germ makes | Tetanus, diphtheria |
| mRNA | Instructions that let your cells make one harmless germ protein for a short time | COVID-19 |
| Viral vector | A harmless, modified virus that delivers the instructions | Ebola |
- Why boosters? Some vaccines need several doses to build strong, lasting memory. HHS notes that inactivated vaccines often need booster doses over time, while live vaccines can give long-lasting protection after one or two doses.
- Sore arm or mild fever after a shot? That's usually your innate immune system reacting, the same inflammation from lesson 3. It typically passes in a day or two.
- Community protection. When most people are immune, a germ has trouble spreading, which helps protect babies too young for some vaccines and people whose immune systems are weak.
When the system misfires
- Allergies: the immune system overreacts to something harmless, like pollen or peanuts.
- Autoimmune diseases: it mistakes your own tissue for “not self,” as in type 1 diabetes or rheumatoid arthritis.
- Immunodeficiency: part of the system is missing or weakened, from birth or from things like HIV, chemotherapy or some medicines.
Antibiotics vs viruses. Antibiotics kill bacteria. They do nothing against viruses like colds and flu. For viral infections, your immune system does the work (sometimes with antiviral medicine).
FAQCommon questions
Should I bring down a fever with medicine?
A fever itself is part of the fight, so a mild one doesn't always need treatment. Fever reducers can make you more comfortable. Follow the label, never give aspirin to children or teens, and call a doctor using the temperature guidelines in lesson 3.
What's the difference between innate and adaptive immunity?
Innate immunity is the fast, general defense you're born with. Adaptive immunity is slower the first time, targets one specific germ with B cells, T cells and antibodies, and remembers it.
How long do memory cells last?
It depends on the germ and the vaccine. Some memory lasts for life, like after measles. Other protection fades, which is why some vaccines need boosters.
Why do I feel sick after a vaccine if it has no live germ?
A sore arm, tiredness or a mild fever is your immune system responding to the antigen. It's not the disease. These effects usually pass within a day or two.
Can you “boost” your immune system?
No pill or food supercharges it. What helps is staying up to date on vaccines, sleeping well, eating a balanced diet, being active, not smoking, and washing your hands.
What are swollen glands?
They're lymph nodes, where immune cells gather and get activated. They swell when they're busy fighting a nearby infection and usually shrink back once it clears.