Allergies occur when the immune system overreacts to normally harmless foreign substances (allergens). In this scenario, the immune system categorizes these substances as dangerous, and an excessive immune response leads to symptoms. In contrast, in autoimmune diseases, the immune system directly perceives and attacks its own body's components as enemies.