Esophageal spasms are abnormal muscle contractions in the esophagus. They can cause severe pain and difficulty in swallowing. They are estimated to affect around 80,000 people worldwide.
The precise cause is unknown. Possible factors involved are: a defect in the nitric oxide pathway; abnormalities in the nervous system; visceral hypersensitivity; gastro-oesophageal reflux and smooth muscle thickening in the oesophageal wall.
Source : Patient Info, UK
They are sometimes linked to eating or drinking, but can also occur spontaneously, i.e. with unknown triggers.
Technical info : StatPearls