What I was told by medical professionals is that it’s caused by stress.
And that stress and be any kind: illness, fatigue, physical exertion, emotional stress, whatever puts your body under stress.
Got it just before Thanksgiving could not go to Thanksgiving dinner at my daughters as she just had a new baby. It started on the top of my head and worked down to my right eyebrow and near the corner of my right eye. Saw my eye doctor twice to make sure there were no eye problems. Had the vaccine shot about 5 years ago. If it lessened the the experience Im glad but It sure hurt.