Gases such as carbon dioxide and methane are produced during the bacterial decomposition process of lactose in the intestinal tract. These gases build up in the intestine and cause severe and sometimes painful flatulence.