Immunity is a biological term that describes a state of having sufficient biological defenses to avoid infection, disease, or other unwanted biological invasion. In other words, it is nothing but the capability of the body to resist harmful microbes from entering the body.
Immunodeficiency (or immune deficiency) is a state in which the immune system’s ability to fight infectious disease is compromised or entirely absent. Immunodeficiency may also decrease cancer immunosurveillance. Most cases of immunodeficiency are acquired (“secondary”) but some people are born with defects in their immune system, or primary immunodeficiency. Transplant patients take medications to suppress their immune system as an anti-rejection measure, as do some patients suffering from an over-active immune system. A person who has an immunodeficiency of any kind is said to be immunocompromised. An immunocompromised person may be particularly vulnerable to opportunistic infections, in addition to normal infections that could affect everyone.