WebMD explains that onions cause gas in individuals who do not produce enough of the stomach enzymes that are needed for proper digestion. When undigested onions move into the large intestine, bacteria produces hydrogen, carbon dioxide and methane in order to complete the digestion process. The gas created during the digestive process is then passed through the body.
According to the National Digestive Diseases Information Clearinghouse, whether or not onions cause gas depends on how well the individual consuming the onions digests carbohydrates, as well as the specific type of bacteria that is present in the intestines. An overgrowth of bacteria in the digestive tract can lead to excess gas.
According to the Mayo Clinic, gas that is not passed through the intestines can build up and cause bloating and pain. Pain can range from mild to intense and is often relieved with the passing of a bowel movement. The Mayo Clinic advises individuals who suffer from gas after eating onions and high carbohydrate foods to minimize their intake of these foods. It is important for people with gas to consult with a health professional if the gas is chronic or gas pains interfere with daily activities, as these symptoms can point to an underlying medical issue.