The immune response is how your body recognizes and defends itself against bacteria, viruses, and substances that appear foreign and harmful.The immune system protects the body from possibly harmful substances by recognizing and responding to antigens. Antigens are substances (usually proteins) on the surface of cells, viruses, fungi, or bacteria. Nonliving substances such as toxins, chemicals, drugs, and foreign particles (such as a splinter) can also be antigens. The immune system recognizes and destroys substances that contain antigens. Your own body’s cells have proteins that are antigens. These include a group of antigens called HLA antigens. Your immune system learns to see these antigens as normal and usually does not react against them.
Source: NIH.gov