Why Legumes Cause Gas and How to Prevent It
Chickpeas and beans contain a type of complex sugar (oligosaccharides) that our body has no enzyme to digest. So the body passes it on to the large intestine, where gut bacteria step in to help break it down. The bacteria in the large intestine ferment these sugars, and the byproduct of that fermentation is gas — it gets released, builds up in the large intestine, and causes flatulence.
When we soak legumes — say for 8 to 12 hours — and change the water, a large share of those complex sugars leaches into the water and gets poured away with each water change; the legumes are, so to speak, de-bloated. Soaking for 8 to 12 hours and changing the water two or three times is enough: whatever gas-causing sugars can be removed are removed within that time, and soaking longer doesn't add much. Just one thing — if the weather is hot and the soak will be long, put the bowl in the fridge so the water doesn't turn sour.