There is no one cause for the onset of anorexia nervosa
eating disorder. Predisposing factors, including genetic susceptibility, have been shown in research to account for up 60% of cause of onset.
Precipitating factors are often related to emotional factors and stressors including trauma. Social and media expectations also receive some blame. Short answer, a combination of biology/environment.