The best way to know anything for sure is to test. I mean yeah, it might be an imbalance in gut flora, an overgrowth, leaky gut, environmental sensitivities, ect. You really can't know for sure unless you test.
If you have a naturopath that can help you (most conventional MD's are clueless) they could help you resolve a lot of issues and get down to the bottom of the cause, then treat it accordingly.