Foundations
How an erection actually works
The plumbing and the wiring, in plain terms: nerves, nitric oxide, smooth muscle, and the two jobs that turn arousal into rigidity you can keep.
Published · Last reviewed · How we review →
Almost every problem the rest of this library covers is a breakdown at one specific step of a process most men never had explained to them. So here's the whole thing, start to finish — the wiring and the plumbing — in plain language. Once you can see the steps, you can see where yours is failing, and why a given treatment targets the part it does.
The anatomy, in one paragraph
The penis has two spongy cylinders running its length, the corpora cavernosa, wrapped in a tough fibrous sheath called the tunica albuginea. Those cylinders are full of tiny blood spaces lined with smooth muscle. At rest, that muscle is contracted, the spaces are squeezed small, and only a little blood passes through — the penis is soft. An erection is what happens when that muscle relaxes and the spaces fill. Everything below is just the story of how that relaxation is switched on and how the blood is then kept in.
The sequence
The signal
Arousal — from touch, sight, thought, or the reflexes of sleep — sends nerve signals down the spinal cord to the nerves of the penis. This is the wiring. If the nerves are damaged (by diabetes, or by prostate surgery), the message never fully arrives, no matter how strong the desire.
The chemical switch: nitric oxide
Those nerves (and the vessel lining itself) release nitric oxide. It's the on-switch: it tells the smooth muscle inside the chambers to relax. This is the exact step PDE5 pills protect — they don't create an erection, they keep the nitric-oxide signal working longer, which is why they still need real arousal to do anything.
The inflow
With the muscle relaxed, the arteries feeding the chambers open wide and blood rushes in, far faster than it normally would. The spongy spaces expand and the penis begins to swell and stiffen. This is the first of the two jobs: getting blood in. Narrowed, unhealthy arteries (the same ones heart disease affects) can't deliver enough — which is why erectile trouble can be an early warning sign.
The trap
As the chambers swell, they press the small draining veins flat against the tunica albuginea, pinching off the exits. Blood is now trapped, pressure climbs, and a full, firm erection you can keep is the result. This second job — holding the blood — is the one that fails in venous leak, where the seal never fully closes and the erection drains away.
The return to soft
After orgasm, or when arousal passes, the smooth muscle contracts again, the arteries narrow, the veins reopen, and blood drains back out. The penis returns to its resting state until the next signal starts the sequence over.
Where testosterone and the brain fit
Notice what isn't in the five steps: testosterone. It matters — it drives desire and helps keep the penile tissue and nitric-oxide system healthy over time — but the mechanics of a single erection are mostly arteries, nerves, and smooth muscle. That's why a man can have perfectly normal testosterone and still have ED, and why testosterone alone often doesn't fix it. The brain, meanwhile, can override the whole sequence from the top: anxiety and stress tighten the very smooth muscle that needs to relax, which is how psychogenic ED works even when the plumbing is flawless.
Sources & important note
Drawn from: StatPearls: Physiology, Erection (the neural, nitric-oxide, and veno-occlusive mechanism); and the AUA Erectile Dysfunction Guideline (how the physiology maps to evaluation and treatment).
General education, not medical advice. If your own sequence is failing somewhere, the workup is how a clinician finds the step — and if something feels acutely wrong, get support now.
Common questions
How does an erection actually work?
Arousal signals travel down nerves to the penis and trigger the release of nitric oxide, which relaxes the smooth muscle inside the two spongy chambers (the corpora cavernosa). The relaxed chambers let arteries flood them with blood, and as they swell they press the draining veins shut against the firm outer wall, trapping the blood in. Inflow plus trapping is what turns arousal into a firm, lasting erection.
Is an erection about blood flow or testosterone?
Mostly blood flow. An erection is fundamentally a vascular event: it needs healthy arteries, nerves, and smooth muscle. Testosterone matters more for desire and for keeping the tissue healthy than for the mechanics of a single erection, which is why many men with normal testosterone still have erectile dysfunction, and why testosterone alone often doesn't fix it.
What role does nitric oxide play in an erection?
It's the on-switch. Nitric oxide is the signaling molecule that relaxes the penile smooth muscle so blood can rush in. PDE5 inhibitors like sildenafil and tadalafil work by protecting that same nitric-oxide pathway so its effect lasts longer, which is also why they need some arousal to work rather than creating an erection from nothing.
Why can't I get an erection even when I'm aroused?
Because arousal is only the first step; the plumbing has to follow through. If the arteries are narrowed, the nerves aren't signaling, the smooth muscle can't relax, or the veins won't seal, you can feel fully aroused and still not get or keep an erection. Which step is failing is exactly what an erectile-dysfunction workup is designed to find.