Causes
Bladder
Infection
Detrusor sphincter dyssynergia
Neurogenic bladder (commonly spinal cord damage, pelvic splanchic nerve damage, cauda equina syndrome,  pontine micturition or storage center lesions, demyelinating diseases or Parkinsons disease)
Iatrogenic (caused by medical treatment/procedure) scarring of the bladder neck (commonly from removal of indwelling catheters or cystoscopy operations)
Damage to the bladder

Prostate
Benign prostatic hyperplasia (BPH)
Prostate cancer and other pelvic malignancies
Prostatitis

Penile urethra
Congenital urethral valves
Phimosis or pinhole meatus
Circumcision
Obstruction in the urethra, for example a stricture (usually caused either by injury or STD), a metastasis or a precipitated pseudogout crystal in the urine
Pseudodyssynergia
STD lesions (gonorrhoea causes numerous strictures, leading to a "rosary bead" appearance, whereas chlamydia usually causes a single stricture)
Emasculation

Postoperative
Risk factors include

Age: Older people may have degeneration of neural pathways involved with bladder function and it can lead to an increased risk of postoperative urinary retention. The risk of postoperative urinary retention increases up to 2.11 fold for people older than 60 years. Medications: Anticholinergics and medications with anticholinergic properties, alpha-adrenergic agonists, opiates, nonsteroidal anti-inflammatories (NSAIDs), calcium-channel blockers and beta-adrenergic agonists, may increase the risk. Anesthesia: General anesthetics during surgery may cause bladder atony by acting as a smooth muscle relaxant. General anesthetics can directly interfere with autonomic regulation of detrusor tone and predispose people to bladder overdistention and subsequent retention. Spinal anesthesia results in a blockade of the micturition reflex. Spinal anesthesia shows a higher risk of postoperative urinary retention compared to general anesthesia. Benign prostatic hyperplasia: Men with benign prostatic hyperplasia are at an increased risk of acute urinary retention.
By the age of 70, almost 10 percent of males have some degree of BPH and 33% have it by the eighth decade of life. While BPH rarely causes sudden urinary retention, the condition can become acute in the presence of certain medications including antihypertensives, antihistamines, and antiparkinson medications, and after spinal anaesthesia or stroke.In young males, the most common cause of urinary retention is infection of the prostate (acute prostatitis). The infection is acquired during sexual intercourse and presents with low back pain, penile discharge, low grade fever and an inability to pass urine. The exact number of individuals with acute prostatitis is unknown, because many do not seek treatment. In the US, at least 1–3 percent of males under the age of 40 develop urinary difficulty as a result of acute prostatitis. Most physicians and other health care professionals are aware of these disorders. Worldwide, both BPH and acute prostatitis have been found in males of all races and ethnic backgrounds. Cancers of the urinary tract can cause urinary obstruction but the process is more gradual. Cancer of the bladder, prostate or ureters can gradually obstruct urine output. Cancers often present with blood in the urine, weight loss, lower back pain or gradual distension in the flanks.Urinary retention in females is uncommon, occurring 1 in 100,000 every year, with a female-to-male incidence rate of 1:13. It is usually transient. The causes of UR in women can be multi-factorial, and can be postoperative and postpartum. Prompt urethral catheterization usually resolves the problem.