Immune deficiencies may be inherited, or have some other cause.
If an immune deficiency is inherited, it is called a primary immune deficiency. Some examples of primary immune deficiencies are X-linked Agammaglobulinemia (caused by mutation in the BTK gene); Job syndrome (caused by mutation in the STAT3 gene); and severe combined immunodeficiency (SCID). There are over 400 known genetic primary immunodeficiencies, and the number of acquired immunodeficiencies is also large.
If an immune deficiency occurs after an exposure later in life, it is called an acquired immune deficiency. Some examples of acquired immune deficiencies are AIDS from the HIV virus and neutropenia from chemotherapy.