Picked wrong parents. Hay fever aka allergic rhinitis is an inherited condition. I like to say that noses run in families. One or both of your parents probably have allergic rhinitis, asthma or eczema. If one parent has one of these atopic diseases your chances are 50:50. If both are affected your risk in ~80%. If neither parent has allergies your risk is only 10%.
Genes and exposure. Allergic rhinitis or hay fever developes when one has the genetic predisposition or genes to make allergic antibodies or ige. Usually this is passed on from one or both parents. Additionally you need to have exposure to protein or protein containing substances that are inside or outdoors such as dust mite, animal danders, pollens or mold. If you lived in a bubble--you wouldn't have allergies.