Peptic ulcer can result from disruption of mucosal integrity of stomach . The main causes are infection due to Helicobacter pylori and nonsteroidal anti-inflammatory drugs (NSAIDs).
The mucus of the stomach contains bicarbonate which lubricates the stomach wall to protect it from getting digested by the hydrochloric acid present in the stomach. If mucus is not secreted by the gastric glands, the walls of the stomach will get digested by the HCl secreted there.