It is a complicated explanation but when someone takes too many opiates
(and each person's level is different depending on their tolerance) it basically causes the muscles that help the bladder
expel the urine
to become "lazy" and not respond as quickly and as forcefully as they normally do.
Luckily, this is a temporary condition that goes away as the opiates clear out of the body.