The immune system is the body’s tool for preventing or limiting infection. Its complex network of cells, organs, proteins, and tissues enable the immune system to defend the body from pathogens.

A fully functional immune system can distinguish healthy tissue from unwanted substances. If it detects an unwanted substance, it will mount an immune response — a complex attack to protect the body from invaders like bacteria, viruses, and parasites. It also recognizes and removes dead and faulty cells.

The immune system does not always get it right, however. Sometimes, for instance, it is unable to fight effectively because a person has a health condition or needs certain medications that affect how the system works.

In autoimmune diseases and allergies, the immune system mistakenly perceives healthy tissue as unhealthy and launches an unnecessary attack, leading to uncomfortable and sometimes dangerous symptoms.

This article will look at some of the main features of the immune system and how they defend the body from pathogens and other invaders. It will also look at problems that can arise with the immune system.

The immune system consists of a range of components, including:

White blood cells circulate in the blood and lymphatic vessels.

The lymphatic system forms a network similar to the blood vessels. It carries a substance called lymph instead of blood. Lymph is a fluid that carries immune-related cells to areas that need them.

White blood cells are constantly looking for pathogens. When they find one, they begin to multiply and send signals to other cell types to do the same.

The body stores white blood cells in different places, known as lymphoid organs.

These include:

  • The thymus: A gland behind the breastbone, where white blood cells known as lymphocytes mature.
  • The spleen: An organ at the upper left of the abdomen where immune cells gather and work.
  • Bone marrow: Soft tissue in the center of the bones that produces red and white blood cells.
  • Lymph nodes: These are small, bean-shaped glands throughout the body, especially in the neck, underarms, groin, and abdomen. They link via lymphatic vessels. Immune cells gather in lymph nodes and react when antigens are present. This can lead to swelling.
  • The tonsils, adenoids, and appendix: These are gateways for pathogens to enter the body, so lymphoid tissue is also there.

What does a high white blood cell count mean?

The immune system needs to be able to distinguish healthy from unhealthy cells and tissue to work effectively. It does this by recognizing signals called DAMPS — danger-associated molecular patterns.

Cell damage may be present for many reasons, including:

  • infectious agents, such as bacteria or viruses
  • toxins, such as a bite or sting
  • noninfectious physical damage, for instance, a burn
  • a genetic problem within cells, as happens with cancer

An antigen is any substance that can spark an immune response.

In many cases, an antigen is a bacterium, fungus, virus, toxin, or foreign body. But it can also be a cell that is faulty or dead.

The immune system detects pathogen-associated molecular patterns — PAMPs — in the antigen. In this way, various parts of the system recognize the antigen as an invader and launch an attack.

What is an antigen test?

There are two main types of leukocytes, or white blood cells:

1. Phagocytes

These cells surround and absorb pathogens and break them down, effectively eating them.

There are several types, including:

  • Neutrophils: These are also known as granulocytes and provide an early response to inflammation. They kill pathogens but also die as a result.
  • Macrophages: These clean up after a response. They remove pathogens, dead neutrophils, and other debris.
  • Dendritic cells: These activate the immune response and help engulf microbes and other invaders.
  • Monocytes: These can differentiate into dendritic cells and macrophages, as needed.
  • Mast cells: These trigger an immune response when they detect an antigen.

2. Lymphocytes

Lymphocytes help the body remember previous invaders and recognize them if they return to attack again.

Lymphocytes begin their life in bone marrow. Some stay in the marrow and develop into B lymphocytes (B cells); others travel to the thymus and become T lymphocytes (T cells). These two cell types have different roles.

B lymphocytes produce antibodies and help alert the T lymphocytes. T lymphocytes destroy compromised cells in the body and help to alert other leukocytes.

Natural killer (NK) cells are also lymphocytes. NK cells recognize and destroy cells that contain a virus.

What do low lymphocyte levels mean?

The role of B lymphocytes

Once B lymphocytes spot the antigen (antibody generators), they begin secreting antibodies. Antibodies are special proteins that lock on to specific antigens.

Each B cell makes one specific antibody. For instance, one might make an antibody against the bacteria that cause pneumonia, and another might recognize the common cold virus.

Antibodies are part of a large family of chemicals called immunoglobulins, which play many roles in the immune response:

  • Immunoglobulin G (IgG) marks microbes so other cells can recognize and deal with them
  • IgM specializes in killing bacteria
  • IgA congregates in fluids, such as tears and saliva, where it protects gateways into the body
  • IgE protects against parasites and plays a role in allergies
  • IgD stays bound to B lymphocytes, helping them start the immune response

Antibodies lock on to the antigen but do not kill it — they only mark it for death. The killing is the job of other cells, such as phagocytes.

The role of T lymphocytes

There are distinct types of T lymphocytes, or T cells.

Helper T cells (Th cells) coordinate the immune response. Some communicate with other cells, and some stimulate B cells to produce more antibodies. Others attract more T cells or cell-eating phagocytes.

Killer T cells (cytotoxic T lymphocytes) attack other cells. They are particularly useful for fighting viruses. They work by recognizing small parts of the virus on the outside of infected cells and destroying the infected cells.

The role of natural killer cells

Also a type of lymphocyte, these contain granules with powerful chemicals. They are useful for attacking many types of unwanted cells.

Overall, the immune system becomes stronger on exposure to different pathogens. By adulthood, most people have had exposure to a range of pathogens and developed more immunity.

Once the body produces an antibody, it keeps a copy so that if the same antigen appears again, the body can deal with it more quickly.

Some diseases, such as measles, can be severe if they occur, which is why experts recommend vaccination. If a person has the measles vaccine, they are unlikely to get the disease.

If an unvaccinated person has measles once, it is also rare to get it again. In both cases, the body stores a measles antibody. The antibody is ready to destroy the virus next time it appears. This is called immunity.

There are three types of immunity in humans:

  • innate
  • adaptive
  • passive

Innate immunity

People are born with some level of immunity that will attack invaders from day one.

This innate immunity includes the external barriers of our body — the first line of defense against pathogens — such as the skin and mucous membranes of the throat and gut.

This response is general and nonspecific.

If pathogens manage to bypass the innate immune system, macrophages will attack them. Macrophages will also produce substances called cytokines, which increase the inflammatory response.

Adaptive (acquired) immunity

A person’s protection from pathogens develops as they go through life.

Thanks to vaccinations and exposure to various diseases, the body develops a range of antibodies to different pathogens. Doctors sometimes refer to this as immunological memory because the immune system remembers previous enemies.

Passive immunity

This is a temporary type of immunity that derives from another person.

For instance, a newborn receives antibodies from the mother through the placenta before delivery and in breast milk following delivery.

This passive immunity protects the infant from some infections during their early life.

Immunizations change the body in some way so it can respond effectively to various diseases.

The most common method is to introduce antigens or weakened pathogens into a person so the individual produces antibodies and does not become sick.

Because the body saves copies of the antibodies, it has protection if the threat should reappear later in life.

Some diseases that doctors recommend immunization for include:

How do COVID-19 vaccines work?

There are many ways in which the immune system can go wrong. Types of immune disorders fall into three categories:


These arise when one or more parts of the immune system do not function.

They can result from:

  • a condition that a person is born with, known as primary immunodeficiency
  • developments over time, for instance, older age
  • a disease that affects the immune system, such as HIV, malnutrition, obesity, or high alcohol use
  • medical treatment, such as chemotherapy, drugs to treat an autoimmune condition, or medications to stop the body from rejecting a transplant

These conditions can increase a person’s risk of becoming sick or experiencing severe symptoms, as the COVID-19 pandemic has shown.

What are examples of immunodeficiency disorders?


In autoimmune conditions, the immune system mistakenly targets healthy cells rather than pathogens or faulty cells. It is unable to distinguish between healthy and unhealthy cells and tissue.

Usually, this will occur in one part of the body, such as the pancreas. Destruction of pancreatic beta cells means the body cannot produce insulin. This is how type 1 diabetes happens.

Other autoimmune diseases include:


With hypersensitivity, the immune system reacts in an exaggerated or inappropriate way. It attacks everyday substances, such as dust, as if they were pathogens.

This happens with:

  • asthma
  • food allergies and sensitivities
  • atopic eczema

A severe reaction can lead to anaphylactic shock, where the body responds to an allergen so strongly that it can be life threatening.

Here are some answers to questions people often ask about immunity.

How can I improve my immunity?

Tips for boosting immunity include:

Find out which foods can boost the immune system here

What types of immunity are there?

Innate immunity refers to the defenses people are born with, including the skin, mucous membranes, and various components of the immune system.

Acquired immunity comes from vaccines and exposure to diseases. These enable the body to develop antigens that can help it fight the same disease a second time.

Passive immunity is protection that comes from another person, for example, when a newborn is temporarily immune to certain diseases because their mother has immunity.

Why is immunity important?

Immunity protects the body from bacteria, viruses, and other pathogens that could lead to life threatening diseases.

The immune system is a complex system that is vital for survival. When the body faces harmful invaders, such as a virus or a splinter in the finger, it launches an attack to destroy the pathogens.

People are born with some types of immunity, but exposure to diseases and vaccinations can also help boost the body’s defenses.

Some people have a weakened immune system because of a health issue or medication use. A doctor can advise on how to protect a person’s health when living with a weakened immune system.

Ways of boosting immunity include dietary and exercise choices, avoiding alcohol and smoking, and having appropriate vaccinations.