system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: When your body does not agree with your food how does it decide whether to make you throw up or cause a bad stomach ache?
gpt
Bad foods can start poisoning you when they reach the stomach. Being poisoned triggers the feeling of nausea which then the body reacts by throwing up. This may help get rid of whatever is poisonous in the stomach whether it's from bad food, an assassin, or too much alcohol.

Bad food can also have a delayed reaction  by affecting the body after it leaves the stomach and goes into the intestines. After this point, there's no way to reverse the food train (with some exceptions from extreme vomiting) so it's gotta come out as fast as possible from the other end. Upset stomach and diarrhea occurs when the body is trying to shove the bad food out the other way as fast as it can. There's no time to reabsorb the liquid so it comes out all wet.