In this article by Gary L. Wenk PhD, he explains how your brain and the bugs in your gut have a symbiotic relationship. The chemicals produced when the gut bugs break down food influences your brain and depending on the food, that can have a good effect or a bad one.
Our brain lives in a symbiotic relationship with the bugs in our gut. Whatever we eat, they eat. In return, they help our brain function optimally in a variety of ways. During the past few years, it has become increasingly apparent that in the absence of bacteria humans would never have evolved to our current level of cognitive performance. Our brains are profoundly dependent upon a wide range of chemicals produced by these gut bugs. For example, without these gut microbes our brains do not correctly develop the serotonin neurons that play a key role in the control of emotion (Molecular Psychiatry 2013;18:666-673)…..Clearly, the bugs in your gut can positively or negatively influence your mental function and stress response; it is definitely worth your effort to keep them very happy with a healthy diet.