Genes + Exposures
There are genetic predispositions for allergies in general, and to specific types of allergies as well (e.
g. Food vs medication vs environmental allergies). However, just the genetics does not guarantee developing an allergy. There must also be an exposure in the "right" situation to trigger the allergy. The details of the "right" situation remains unclear.