The brain tells the bladder and bowel what to do by sending electrical signals to the muscles in the pelvic floor, the sphincters, the urethra as well as the bladder and rectal area.
The commands from the brain to the bowel (colon) and bladder are sent as electrical impulses and are carried by a system of special fibres called nerves.
These signals start in the brain, go through the spinal cord and continue to the nerves located in the sacral area of the back.
There are 31 pairs of these nerves in the lower back. Some of these sacral nerves go to the rectum, the bladder's detrusor muscle, levator ani muscle, and external sphincter muscles, controlling their activities.
Two important sacral nerves to the functioning of the bladder and bowel are the pudendal nerve and the pelvic splanchnic nerve.
Through a series of reflexes and signals the nerves and the bladder and bowel coordinate with the pelvic floor muscles and external urinary and anal sphincters.
This coordination ensures that the sphincters remain closed, opening only during micturition (a term for urination) or defecation.
In other words, when the rectum (or bladder) fills, and the pressure inside it increases, the nerves sense the pressure and tell the brain about it.
The brain then sends signals via the nerves to keep the external sphincter closed. Normally, this prevents leakage. This is called the guarding reflex.
When you're ready to go to the toilet, the brain tells the nerves to signal the rectum (or bladder) to empty, and relax the muscles surrounding the anus (or urethra). The rectum (or bladder) empties and excrement (or urine) is expelled.
The nerve pathways are also shared with fibres that carry sensory signals, such as pain or fullness.
Pain that originates in the pelvic area is transmitted along these pathways to the sacral area, up the spinal cord and back to the brain.
The same happens as the rectum (or bladder) fills. This sensation of filling is registered by the nerves, which transmit the information to the brain.
The nerves also tell the brain whether it's gas or stool that's filling the rectal canal.