From The Good Gut: Taking Control of Your Weight, Your Mood and Your Long-Term Health, by Justin Sonnenburg and Erica Sonnenburg, PhDs. Reprinted by arrangement with Penguin Press, a member of Penguin Group (USA), LLC, a Penguin Random House Company. Copyright © Justin Sonnenburg and Erica Sonnenburg, 2015.

A primal connection exists between our brain and our gut. We often talk about a “gut feeling” when we meet someone for the first time. We’re told to “trust our gut instinct” when making a difficult decision or that it’s “gut check time” when faced with a situation that tests our nerve and determination. This mind-gut connection is not just metaphorical. Our brain and gut are connected by an extensive network of neurons and a highway of chemicals and hormones that constantly provide feedback about how hungry we are, whether or not we’re experiencing stress, or if we’ve ingested a disease-causing microbe. This information superhighway is called the brain-gut axis and it provides constant updates on the state of affairs at your two ends. That sinking feeling in the pit of your stomach after looking at your postholiday credit card bill is a vivid example of the brain-gut connection at work. You’re stressed and your gut knows it—immediately.

The enteric nervous system is often referred to as our body’s second brain. There are hundreds of million of neurons connecting the brain to the enteric nervous system, the part of the nervous system that is tasked with controlling the gastrointestinal system. This vast web of connections monitors the entire digestive tract from the esophagus to the anus. The enteric nervous system is so extensive that it can operate as an independent entity without input from our central nervous system, although they are in regular communication. While our “second” brain cannot compose a symphony or paint a masterpiece the way the brain in our skull can, it does perform an important role in managing the workings of our inner tube. The network of neurons in the gut is as plentiful and complex as the network of neurons in our spinal cord, which may seem overly complex just to keep track of digestion. Why is our gut the only organ in our body that needs its own “brain”? Is it just to manage the process of digestion? Or could it be that one job of our second brain is to listen in on the trillions of microbes residing in the gut?

Operations of the enteric nervous system are overseen by the brain and central nervous system. The central nervous system is in communication with the gut via the sympathetic and parasympathetic branches of the autonomic nervous system, the involuntary arm of the nervous system that controls heart rate, breathing, and digestion. The autonomic nervous system is tasked with the job of regulating the speed at which food transits through the gut, the secretion of acid in our stomach, and the production of mucus on the intestinal lining. The hypothalamic-pituitary-adrenal axis, or HPA axis, is another mechanism by which the brain can communicate with the gut to help control digestion through the action of hormones.

This circuitry of neurons, hormones, and chemical neurotransmitters not only sends messages to the brain about the status of our gut, it allows for the brain to directly impact the gut environment. The rate at which food is being moved and how much mucus is lining the gut—both of which can be controlled by the central nervous system—have a direct impact on the environmental conditions the microbiota experiences.

Like any ecosystem inhabited by competing species, the environment within the gut dictates which inhabitants thrive. Just as creatures adapted to a moist rain forest would struggle in the desert, microbes relying on the mucus layer will struggle in a gut where mucus is exceedingly sparse and thin. Bulk up the mucus, and the mucus-adapted microbes can stage a comeback. The nervous system, through its ability to affect gut transit time and mucus secretion, can help dictate which microbes inhabit the gut. In this case, even if the decisions are not conscious, it’s mind over microbes.

What about the microbial side? When the microbiota adjusts to a change in diet or to a stress-induced decrease in gut transit time, is the brain made aware of this modification? Does the brain-gut axis run in one direction only, with all signals going from brain to gut, or are some signals going the other way? Is that voice in your head that is asking for a snack coming from your mind or is it emanating from the insatiable masses in your bowels? Recent evidence indicates that not only is our brain “aware” of our gut microbes, but these bacteria can influence our perception of the world and alter our behavior. It is becoming clear that the influence of our microbiota reaches far beyond the gut to affect an aspect of our biology few would have predicted—our mind.

For example, the gut microbiota influences the body’s level of the potent neurotransmitter serotonin, which regulates feelings of happiness. Some of the most prescribed drugs in the U.S. for treating anxiety and depression, like Prozac, Zoloft, and Paxil, work by modulating levels of serotonin. And serotonin is likely just one of a numerous biochemical messengers dictating our mood and behavior that the microbiota impacts.