With an allergy, the immune system mistakenly identifies a food as harmful, triggering immunoglobulin E (IgE) antibodies to fight the substance.