“The overall function of the immune system is to prevent or limit infection. The immune system can distinguish between normal, healthy cells and unhealthy cells by recognizing a variety of “danger” cues called danger-associated molecular patterns (DAMPs). Cells may be unhealthy because of infection or because of cellular damage caused by non-infectious agents like sunburn or cancer. Infectious microbes such as viruses and bacteria release another set of signals recognized by the immune system called pathogen-associated molecular patterns (PAMPs).When the immune system first recognizes these signals, it responds to address the problem. If an immune response cannot be activated when there is sufficient need, problems arise, like infection.”
NIH The National Institute of Allergy and Infectious Disease