Bacteria in the large intestine break down undigested foods and release gas. This gas is passed through the anus.