H. pylori is present in the stomach of many people, but most never develop ulcers. It's not understood why some people develop ulcers and some do not, or even how H. pylori is spread. It is now known that while stress and diet (alcohol and spicy food) do not cause stomach ulcers, they can certainly worsen the symptoms of an existing ulcer.
Ulcers caused by H. pylori are treated with antibiotics and acid suppression medications. Ulcers caused by NSAIDs are treated by avoiding the use of NSAIDs and taking medication to reduce stomach acid.
Sources:
National Digestive Diseases Information Clearinghouse. "H. pylori and Peptic Ulcers." National Institute of Diabetes and Digestive and Kidney Diseases Apr 2010. 26 Jan 2011.
National Digestive Diseases Information Clearinghouse. "NSAIDs and Peptic Ulcers." National Institute of Diabetes and Digestive and Kidney Diseases Apr 2010. 26 Jan 2011.

