How Does a Boner Work? The Biology Explained

An erection is a hydraulic event. When arousal triggers a chemical chain reaction in the penis, arteries open wide, spongy tissue fills with blood, and veins get physically squeezed shut to keep that blood trapped under pressure. In a flaccid state, blood flow through the main penile artery is only about 5 ml per minute. During arousal, that flow increases dramatically as the tissue expands to several times its resting volume.

Two Ways an Erection Starts

There are two distinct pathways that can trigger an erection, and they use different sets of nerves. A psychogenic erection starts in the brain, sparked by something you see, hear, imagine, or remember. The signals travel down the spinal cord through nerves in the mid-to-lower back region (around the T11 to L2 vertebrae). A reflexogenic erection bypasses the brain entirely: direct physical touch to the genitals sends signals through a lower set of nerves near the base of the spine (S2 to S4), creating a reflex arc that triggers the erection locally.

Both pathways can work independently. This is why erections can happen from thought alone with no physical contact, or from physical stimulation even when someone isn’t mentally aroused. In practice, most erections involve both pathways reinforcing each other.

The Chemical Signal That Opens Blood Flow

Regardless of which pathway fires first, the result is the same: nerve endings and blood vessel walls in the penis release nitric oxide, a small signaling molecule. Nitric oxide kicks off a cascade inside the smooth muscle cells that line the spongy chambers of the penis. It activates an enzyme that produces a messenger molecule called cGMP, which tells those muscle cells to relax.

This relaxation is the key event. The penis contains two long cylinders of spongy tissue packed with tiny blood-filled spaces, like a dense network of expandable pockets. When the smooth muscle cells surrounding these pockets relax, the pockets open up and arterial blood rushes in under pressure.

Testosterone plays a supporting role in this process. Animal studies show that low testosterone reduces the activity of the enzyme responsible for producing nitric oxide by roughly 45%. Testosterone also appears to dial down the signals that keep penile blood vessels constricted, making it easier for the relaxation process to succeed.

How the Erection Stays Hard

Filling with blood is only half the equation. The penis also has to trap that blood, and it does this through an elegant mechanical trick. The spongy chambers are wrapped in a tough, fibrous outer sheath. As the chambers swell with blood, they expand outward against this sheath, which thins from about 2 mm to just 0.5 mm but holds firm. Tiny veins that normally drain blood out of the penis run between the inner spongy tissue and this outer sheath. As the tissue expands, these drainage veins get physically compressed against the sheath like a garden hose pinched against a wall.

This is called the veno-occlusive mechanism: blood flows in through arteries that are wide open, but it can’t flow out because the exit veins are squeezed shut. The result is a pressurized, rigid erection. The outer sheath is essential to this process. Without its structural integrity, the veins wouldn’t compress properly and blood would leak back out, making it difficult to maintain firmness.

How an Erection Ends

An erection resolves when the chemical signal that started it gets broken down. A specific enzyme in the penile tissue works to destroy cGMP, the messenger molecule responsible for keeping the smooth muscle relaxed. As cGMP levels drop, the smooth muscle cells contract again, the spongy chambers shrink, and the compression on the drainage veins releases. Blood flows back out, and the penis returns to its flaccid state.

This is also why common erectile dysfunction medications work the way they do. They block that cleanup enzyme, allowing cGMP to accumulate and persist longer. They don’t create an erection from nothing; they make it easier for the natural arousal signal to produce and maintain one.

Why Erections Happen During Sleep

Erections aren’t limited to sexual arousal. Sleep-related erections are involuntary episodes that occur in a predictable cycle tied to REM sleep, the phase associated with dreaming. In a healthy young adult, an erection typically begins near the start of each REM period, reaches full firmness quickly, lasts for the duration of that REM episode, and then subsides when REM ends. Since most people cycle through REM sleep multiple times per night, this means several erections happen every night without any conscious sexual thought.

These sleep erections occur in all healthy males from infancy through old age, though they become less frequent and less firm with aging. They’re thought to serve a maintenance function, periodically oxygenating the penile tissue. They’re also clinically useful: if someone has erection difficulties when awake but normal erections during sleep, it suggests the blood flow mechanics are intact and the issue is more likely psychological or neurological rather than vascular.

The Refractory Period After Ejaculation

After ejaculation, most men experience a window of time during which another erection is difficult or impossible. This refractory period is driven by changes in the brain rather than in the penis itself. Ejaculation triggers a shift in brain chemistry: levels of the excitatory signals that support arousal drop sharply, while inhibitory signals ramp up across several brain regions and the spinal cord.

Interestingly, prolactin (a hormone that rises after orgasm) has long been blamed for the refractory period, but current evidence suggests it plays essentially no role in causing it. The refractory period appears to be driven primarily by changes in nerve signaling, particularly inhibitory signals sent from the brainstem to the spinal circuits involved in erection and ejaculation. The duration varies enormously between individuals and gets longer with age, ranging from minutes in younger men to hours or longer in older men.

When the Mechanism Breaks Down

Because erections depend on healthy blood vessels, intact nerves, adequate hormones, and proper chemical signaling, a problem at any point in the chain can cause difficulty. Vascular issues are the most common culprit. Conditions that damage blood vessels, like diabetes, high blood pressure, and heart disease, can impair both the arterial inflow and the veno-occlusive trapping mechanism. In fact, erectile difficulty sometimes appears years before other cardiovascular symptoms, making it an early warning sign of blood vessel disease elsewhere in the body.

Nerve damage from surgery, spinal cord injury, or conditions like multiple sclerosis can interrupt the signaling pathways. Low testosterone can weaken the nitric oxide signal. Psychological factors like anxiety, stress, or depression can suppress the psychogenic pathway. And some medications, particularly certain antidepressants and blood pressure drugs, interfere with the chemical cascade at various points.

Clinicians use a five-question scoring tool to categorize erectile function on a scale from 5 to 25. A score of 22 to 25 indicates normal function, 17 to 21 suggests mild difficulty, and scores below 12 point to moderate or severe dysfunction. But the underlying causes matter more than the score, since treatment depends on whether the issue is vascular, hormonal, neurological, or psychological.