My understanding is beans contain an abundance of a complex sugar that we can not taste nor digest. But the bacteria in our lower gut loves it and guess what’s the byproduct?
That’s why soaking overnight in water helps. The sugar culprit is water soluble and is drawn out by soaking. Rinsing canned beans helps the same way.
Right, it’s the complex sugars that do it but I’m not convinced that soaking has much effect. I used to always soak my beans, but since reading that article I’ve experimented with skipping it and I can’t tell much difference.