The structure is called the lower esophageal sphincter:
![](
Basically, its function is to prevent the contents of the stomach, including stomach acid, from "backwashing" into the esophagus. The stomach is protected from acid by a protective layer of mucus, while the esophagus is not, so any number of medical issues which cause problems with this sphincter may lead to erosion in the esophagus, which is quite painful and can lead to serious long-term consequences if not addressed.