The stomach normally does not digest itself because of a mechanism which regulates gastric secretion. This checks the secretion of gastric juice before the content becomes sufficiently corrosive to damage the mucosa. Pure gastric juice can destroy the mucosa and produce a peptic ulcer. An ulcer forms when gastric secretion is stimulated by agencies other than food and when its buffering effect is absent or inadequate.
Dragstedt LR. Why Does Not the Stomach Digest Itself?. JAMA. 1961;177(11):758–762. doi:10.1001/jama.1961.03040370020004