There's some really interesting literature about this topic, I only discovered it recently. I'd recommend starting with 'The Good Gut' by Justin Sonnenburg.
An excerpt can be found here: https://www.scientificamerican.com/article/gut-feelings-the-...