Your stomach makes a strong acid that helps to digest food and protects against infection. Mucus lines your stomach, oesophagus and bowel as a barrier against this acid. If the mucous layer is damaged, the stomach acid can irritate the tissues beneath.
Attribution: BUPA