system
Given the following post, respond as if you're commenting on Reddit:
human
Why do people pee whilst pooping?
gpt
It's a shame to see this question getting downvoted. Presumably that's because people think that your language is crude or vulgar. Science should not be hindered by such taboos. Everybody poops!

But the answer to your question is an easy one. To speed defecation (i.e. to poop quickly), humans contract their abdominal muscles. This increases the pressure inside their abdomen, forcing its contents (i.e. poop) out. However, increasing intra-abdominal pressure also puts pressure on your bladder.

Your bladder is specially designed to contract and make you pee whenever it senses pressure. This is called the micturition reflex. Usually, pressure in the bladder is a sign that the bladder is full, so peeing is necessary. But when you are pooping (and straining a bit, which increases the pressure in your abdomen) the bladder senses this increased pressure and contracts.

The reason you sometimes can't stop yourself from peeing is that the combined pressure of your abdomen contracting to poop and your bladder contracting reflexively overpowers your external urethral sphincter.