H. pylori is a common bacterium. It can cause peptic ulcers by damaging the stomach lining (mucosa). This lining produces a mucous coating that protects the stomach. When the mucous coating is damaged, strong stomach acid can get through to the lining. Together, the stomach acid and H. pylori irritate the lining of the stomach or duodenum and cause an ulcer.
Most people infected with H. pylori never develop ulcers. We don’t know why the bacterium causes ulcers in some people and not in others. It likely depends on your body’s makeup and the type, or strain, of H. pylori.