In general, from the Latin, it means "holding back" The word is used in Medicine for constipation, an impaction of the large intestine by feces. It also refers to the closure of the bladder resulting in an awful bursting pain, because not a drop of urine will come out. That can happen by taking in too many liquids, ignoring the need to piss for hours, and having the full bladder rest on the urethra thus closing it down or having an enlarged prostate pressing on the same tube that empties the bladder. Many drugs, such as cough syrup and some antidepressants, cause temporary retention. Recreational drugs such as ecstasy, morphine, codeine and heroin and methadone may close down the bladder, sometimes for 24 hours. Surgery near the bladder area may upset the local nerves and may lead to retention of urine for 24 to 48 hours or more.
One of my friends took a lot of ecstasy at at a party. After about 5 hours he had a terrible need to empty his bursting bladder. He couldn't pass any pee, not a drop. That went on for 18 hours until he could urinate. That retention led him to give up drugs. Last year I had a hernia operation. After I came to, a beautiful nurse palpated my bladder area and found I had retention of urine. I hadn't gone for about 10 hours. I said I'll go to the toilet. Nothing would come out. I was glad when she held my penis, catheterized me, and emptied out about a quart of piss. Retention of urine is no fun not even when a good looking nurse opened me up.