An erection begins with sensory and mental stimulation. Impulses from the brain travelling down the spinal column and impulses from the nerves in the penis relax smooth muscles in two spongy cylinders that run the length of the penis, parallel to the urethra (the conduit for urine and semen). When the impulses cause the muscles to relax, blood flows into spaces in the spongy tissue, and this pressure makes the penis swell out. A membrane surrounding the cylinders helps to trap the blood in the penis and maintain the erection. The penis returns to its flaccid state if the muscles contract, stopping the inflow of blood and opening outflow channels.
An erection problem can occur if any of the events in this sequence are disrupted: the problem may involve mental processes, nerve impulses, or responses in muscles, fibrous tissue, veins and arteries in the penis.