Beans & lentils
Similar to some fruits and vegetables, beans and lentils contain a sugar called oligosaccharide, which Verywell explains is not easily digested. Oligosaccharides require methane-releasing bacteria to be broken down, which causes bloating.