In allergies, the immune system mistakes harmless substances as threats and produces an immune response. It releases antibodies specific to the allergen, which in turn trigger the release of chemicals like histamine. This immune response causes inflammation and leads to allergy symptoms.