In the study, the researchers exposed mice to social disruption, which is known to cause increases in circulating cytokines (hormones of the immune system), which themselves induce enhanced reactivity in the immune system. The researchers found that social disruption altered bacterial counts of some gut bacteria sub-populations, particularly when the bacteria were assessed immediately after stress exposure. Stress exposure increased the relative abundance of bacteria in the genus Clostridium, which often causes prolonged and severe diarrhea.
Not only does stress affect the gut bacterial population, but these organisms are also required for activation of the immune system. Furthermore, we can now see that stress, via its effect on gut bacteria, and hence the immune system (IL-6) can change brain function. We know this because IL-6 activates a certain enzyme (IDO), which actually "steals" or siphons off, tryptophan from its normal metabolic pathway (i.e. conversion into serotonin and then melatonin) and instead converts it into chemicals that increase activity of glutamate (in depression) at an excitatory -- and sometimes toxic -- receptor (NMDA) in the brain. The result of all of this is increased depression, anxiety, and reduced memory. In mice this effect can take months to reverse.
The upshot is that stress, the gut, the brain and the immune system are really intimately linked, and inseparable.