The problem of the cause of gastric and duodenal ulcer is a part of the more general question of the resistance of the gastrointestinal tract to the digestive action of its own secretions. This was well stated in a thoughtful paper by Joseph Warren1 more than fifty years ago:
... The question is: Why do organisms which manifest such power of digesting and assimilating the material they require, leave quite intact those organs or tissues where these processes go on so actively? Why does the stomach digest various albuminous substances so readily, and yet fail to attack its own walls, containing substantially the same material? Why do the intestines, with their much more varied power of digestive action, remain undisturbed and uninjured by this activity? Why does the pancreas secrete at least three vigorous ferments, and yet work on unaffected by each and all of them?
John Hunter2 interested
DRAGSTEDT LR. PATHOGENESIS OF GASTRODUODENAL ULCER. Arch Surg. 1942;44(3):438-451. doi:10.1001/archsurg.1942.01210210042003