Traditionally, ulcers were thought to be caused by too much spicy food, stress, or anxiety. We now know that most ulcers are likely due to infection with bacteria known as Helicobacter pylori (H. pylori).