system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5:How does your stomach know when to evacuate bad food?

When you eat something bad, your stomach starts bloating, making noise and it hurts but more importantly it knows when to evacuate food promptly. How does it do this?
gpt
After you eat a "bad food", the stomach begins the digestion process and during that process some things are absorbed through the stomach lining (also this happens in the digestive tract). 

If bacteria, poisons or even a food that you are allergic to are sensed, it will attempt to protect itself by releasing fluid and by increasing the mucous lining. 

There is an actual "vomit center" in your brain.  There is a trigger zone in this area of the brain that is sensitive to toxins and poisons in the blood stream.  This area is activated as it receives information from the digestive tract (in this case, it also is triggered at times with information from your inner ear, etc.) and it sends the signals to begin the vomiting response.  And then...your body takes care of itself.