There is no one single cause of headshaking in horses. Headshaking has many potential causes which include allergy, light-induced irritation, neuritis (inflammation of the trigeminal nerve), hyper-sensitivity to air currents in the nasal passages, sinusitis, dental disease, ocular lesions, or behavior. Headshaking in horses should be investigated early in its course. Headshaking is a potentially treatable syndrome that is similar to "trigeminal neuralgia" in humans, and responds in some cases to similar medications.
To learn more, please read the article Headshaking.