How Do Guys Get Boners? What Actually Happens

An erection happens when the spongy tissue inside the penis fills with blood and a tough outer sheath traps it there, turning a soft organ rigid. That sounds simple, but the chain of events connecting a thought, a touch, or even a dream to a fully hard penis involves your brain, spinal cord, local nerves, smooth muscle cells, and a single small molecule that kicks the whole process into gear. The mechanics are surprisingly hydraulic, and understanding them sheds light on why erections sometimes fail and what that failure can reveal about broader health.

Where the Signal Starts

Erections begin with nerve signals, and those signals can come from two very different places. The first route is your brain. A sexual thought, a visual cue, a sound, even a memory can generate signals that travel down the spinal cord and out through autonomic nerves to the penis. The second route is direct physical stimulation of the genitals, which triggers a reflex arc in the lower spinal cord without necessarily involving the brain at all. Researchers have traditionally called these “psychogenic” and “reflexogenic” erections, though in real life most erections involve some combination of both pathways feeding into each other.

The spinal cord is the relay hub. It houses the autonomic nerve cells that send pro-erection signals through the parasympathetic (sacral) nerves, as well as anti-erection signals through the sympathetic pathways. Contraction of the pelvic floor muscles, controlled by the pudendal nerve, adds rigidity once an erection is already forming. These spinal neurons respond to input coming from both the genitals below and the brain above, integrating everything into a single output.

Sensory feedback from the genitals plays a bigger role than most people realize. The pudendal nerve carries touch and pressure information from the penis back to the spinal cord, and research confirms that this circuitry is essential not just for triggering reflexive erections but also for maintaining rigidity during sex and coordinating ejaculation.

The Molecule That Makes It Happen

Once nerve signals reach the penis, the actual physical change comes down to one molecule: nitric oxide. Nerve endings and cells lining the blood vessels inside the erectile tissue release nitric oxide, which sets off a chemical chain reaction in the smooth muscle cells that line the spongy chambers called the corpora cavernosa. Nitric oxide activates an enzyme that produces a signaling molecule called cyclic GMP, and cyclic GMP tells those smooth muscle cells to relax.

This relaxation is the key event. In the flaccid state, the smooth muscle inside the corpora cavernosa is contracted, keeping the small arteries squeezed and blood flow low. When nitric oxide triggers relaxation, those arteries open wide, blood rushes in, and the spongy tissue swells. Early experiments on human erectile tissue showed that blocking nitric oxide production shut down the relaxation response almost entirely, and adding nitric oxide back restored it. The dependence on this single molecule is so complete that researchers identified it as the primary mediator of erection decades ago.

The role of cyclic GMP matters for understanding how erection medications work, too. Cyclic GMP is constantly being broken down by an enzyme called PDE5. Drugs like sildenafil (Viagra) block PDE5, which lets cyclic GMP accumulate and the smooth muscle stay relaxed longer. They don’t create an erection from nothing; they amplify the nitric oxide signal that’s already there.

Blood In, Blood Trapped

Smooth muscle relaxation opens the floodgates, but an erection also requires a trapping mechanism. The corpora cavernosa are wrapped in a tough, elastic sheath called the tunica albuginea. As the spongy tissue inside expands with incoming blood, it presses outward against the tunica. That pressure compresses the small veins that normally drain blood out of the penis, pinching them shut against the inner wall of the tunica. Blood keeps flowing in through the arteries but can’t leave through the veins, so pressure builds.

This vein-trapping step, sometimes called the veno-occlusive mechanism, is what takes an erection from partially swollen to fully rigid. Intracavernosal pressure during a full erection rises well above normal blood pressure. Penile rigidity develops as a continuum during these pressure and volume changes, and it depends on both the pressure inside and the mechanical properties of the tissue itself: how expandable the spongy chambers are and how much the tunica can stretch from its flaccid to its erect dimensions.

Once an erection is underway, contraction of the pelvic floor muscles (particularly the ischiocavernosus muscles) can compress the base of the corpora cavernosa, raising internal pressure even further and producing the rigid-erection phase. This is partly reflexive and partly under voluntary control, which is why Kegel-type exercises are sometimes recommended for erectile health.

Three Kinds of Erections

Not every erection follows the same neural script. The psychogenic-reflexogenic distinction mentioned earlier maps onto two fairly different pathways, and there is a third type that catches many people off guard.

  • Psychogenic erections: Triggered by mental stimulation, whether visual, auditory, imaginative, or emotional. Signals originate in the brain and travel down the spinal cord. These are the erections most associated with arousal and desire.
  • Reflexogenic erections: Triggered by direct physical contact with the genitals or surrounding area. The reflex arc runs through the sacral spinal cord and can occur even without conscious arousal. Men with certain spinal cord injuries above the sacral level can lose psychogenic erections but retain reflexogenic ones.
  • Nocturnal erections: These happen during REM sleep in all healthy men, typically three to five times per night, and have nothing obvious to do with sexual dreams. Their function is still unknown, but they involve the same vascular, neurological, and hormonal machinery as waking erections.

Nocturnal erections serve a useful clinical purpose even if their biological purpose remains unclear. Because they happen automatically during sleep, they can help doctors distinguish between physical and psychological causes of erectile dysfunction. If a man has normal nighttime erections but can’t get one during sex, the hardware is working and the problem is more likely psychological. If nocturnal erections are absent too, something in the vascular or neurological system is probably off.

How It Ends

An erection doesn’t just fade on its own by accident. Detumescence, the return to the flaccid state, is an active process. After orgasm or when arousal drops, sympathetic nerve activity ramps up and parasympathetic signaling decreases. This shift causes the smooth muscle in the corpora cavernosa to contract again. As the smooth muscle tightens, the spongy tissue shrinks, pressure on the veins releases, and blood drains out through the now-open venous channels. The whole cycle reverses itself in roughly the same order it began, just in the opposite direction.

The enzyme PDE5 is a big part of this wind-down. It breaks down cyclic GMP, removing the chemical signal that was keeping the smooth muscle relaxed. Without cyclic GMP, calcium floods back into the smooth muscle cells, they contract, and venous drainage resumes. This is why PDE5 inhibitor drugs prolong erections: they slow the breakdown of the molecule responsible for keeping things going.

Why Erections Fail

Erectile dysfunction has a reputation as something that happens to older men, but it can affect anyone, and the causes divide roughly into physical and psychological categories with plenty of overlap.

On the physical side, anything that damages blood vessels, nerves, or the erectile tissue itself can impair the process. The most common culprits are cardiovascular risk factors: high blood pressure, high cholesterol, diabetes, and smoking all damage the endothelial cells that line blood vessels and produce nitric oxide. If those cells can’t produce enough nitric oxide, the smooth muscle doesn’t relax properly, and the whole chain stalls. Diet, exercise, and treatment of conditions like sleep apnea have been shown to improve erectile function in part by reducing the oxidative stress and inflammation that deplete nitric oxide.

Testosterone also plays a supporting role. It doesn’t trigger individual erections directly, but it maintains the health of erectile tissue over time. Research in animal models and clinical settings indicates that low testosterone disrupts the cellular signaling pathways in penile tissue and can produce structural changes that lead to erectile dysfunction. This is why testosterone replacement sometimes helps men with both low hormone levels and erection problems, though it’s not a magic fix on its own.

On the psychological side, anxiety is one of the most common disruptors. An anxiety response increases sympathetic nervous system activity, which is the anti-erection branch. That heightened sympathetic tone both distracts from erotic stimulation and actively opposes the parasympathetic signals needed for smooth muscle relaxation. Performance anxiety can create a frustrating feedback loop: worry about getting an erection makes it harder to get one, which increases the worry.

Erections as a Window Into Cardiovascular Health

One of the more important clinical insights about erections is that erectile dysfunction often shows up years before heart disease does. The reason is straightforward: the arteries supplying the penis are significantly smaller in diameter than the coronary arteries. The same process of endothelial damage and plaque buildup (atherosclerosis) that will eventually narrow coronary arteries narrows penile arteries first, simply because they’re smaller and it takes less plaque to restrict flow.

A systematic review of the link between erectile dysfunction and cardiovascular disease concluded that ED can serve as an early marker to identify men at higher risk of cardiovascular events. The shared root cause is endothelial dysfunction, where the cells lining blood vessels lose their ability to regulate blood flow properly. Because this dysfunction shows up in the smallest arteries first, the penis acts as an early-warning system for what may eventually happen in larger blood vessels elsewhere in the body.

This connection means that a man in his 40s or 50s who develops unexplained erectile dysfunction should take it seriously as a potential cardiovascular signal, not just a sexual inconvenience. Doctors increasingly screen for cardiovascular risk factors when patients present with ED, and it’s one of the rare situations where a symptom in one organ system reliably predicts future trouble in another.

What Aging Does to the Machinery

Erections change with age, and the reasons are structural, not just hormonal. Research examining penile tissue at different ages has found a statistically significant decline in the percentage of smooth muscle content with age, along with an increase in collagen. In other words, the spongy, expandable tissue that fills with blood gradually gets replaced by stiffer, less elastic connective tissue. This shift means the corpora cavernosa can’t expand as much, the veno-occlusive trapping mechanism becomes less efficient, and more stimulation is needed to achieve the same result.

These tissue-level changes are compounded by the general vascular aging that everyone experiences. Endothelial function declines, nitric oxide production drops, and the small arteries feeding the penis lose some of their ability to dilate. The result isn’t usually a complete loss of erections but rather erections that take longer to develop, are somewhat less rigid, and don’t last as long. This is a normal part of aging, distinct from erectile dysfunction as a medical condition, though the line between the two isn’t always crisp.

When Erections Won’t Stop

If insufficient blood flow causes erectile dysfunction, too much trapped blood causes priapism, a prolonged, painful erection that constitutes a medical emergency. The most common form, called low-flow or ischemic priapism, results from a persistent failure of venous drainage. Blood stays trapped in the corpora cavernosa, oxygen levels plummet, carbon dioxide builds up, and the pH of the blood inside drops below 7.0 (acidosis). The erection becomes painful, and if it isn’t resolved, irreversible scarring of the erectile tissue can develop.

Priapism can be triggered by medications (including some psychiatric drugs and blood pressure pills), sickle cell disease, spinal cord injuries, or in rare cases by PDE5 inhibitors. It requires urgent treatment, usually aspiration of the trapped blood and sometimes injection of medications that constrict the blood vessels. The time window matters: the longer blood stagnates, the greater the risk of permanent damage to the tissue that makes future erections possible.

Peyronie’s Disease and Structural Disruption

Erections also depend on the tunica albuginea being uniform and flexible. In Peyronie’s disease, an inflammatory process beneath the tunica leads to the formation of a dense fibrous plaque. This plaque doesn’t expand the way normal tunical tissue does, so when the corpora cavernosa fill with blood, the erection bends or curves toward the plaque. Depending on the location and severity, Peyronie’s can cause significant curvature, pain during erections, and erectile dysfunction.

Peyronie’s is an acquired condition, meaning men aren’t born with it. It typically develops after some degree of trauma to the penis, sometimes so minor the person doesn’t remember it. The resulting inflammatory response produces fibroblast proliferation and collagen deposition in a localized area, creating a hard plaque that distorts the normal architecture. Treatment ranges from observation (mild cases sometimes stabilize or improve) to injections, mechanical traction, and surgery in more severe cases.

Why Humans Don’t Have a Bone

Many mammals have a baculum, a literal bone inside the penis that provides structural rigidity independent of blood flow. Humans don’t. Instead, the human penis relies entirely on the hydraulic mechanism described above, which means erection quality is tightly coupled to vascular and neurological health in a way it isn’t for species that carry built-in skeletal support.

Comparative anatomy studies have found that while humans lack a penile bone, the glans penis contains a dense connective tissue structure called the distal ligament that occupies a similar position and shares some of the same collagen types (types I and III) found in the baculum of other species. This ligament acts as a supporting framework for the glans. Meanwhile, the tunica albuginea in humans contains far more elastic fibers than the equivalent structure in species with a baculum, because in humans the tunica has to stretch and then snap back with every erection cycle, serving as both the expansion chamber and the structural buttress.

The evolutionary trade-off is interesting: losing the bone made erections completely dependent on cardiovascular fitness, which in turn made erectile function a fairly reliable signal of overall health. Some researchers have speculated that this dependency may have played a role in sexual selection, but that remains speculative territory.

Vacuum Devices and Mechanical Alternatives

For men whose natural erectile mechanism doesn’t work well enough, whether from nerve damage after surgery, vascular disease, or other causes, vacuum erection devices offer a purely mechanical workaround. These devices use negative pressure to draw blood into the penis, then a constriction band at the base traps it there, mimicking the veno-occlusive mechanism by external compression rather than internal expansion. They’re particularly common after radical prostatectomy, where nerve damage rates are high. Beyond their use for achieving erections, vacuum devices are used in penile rehabilitation programs because they increase blood flow and oxygenation to the corpora cavernosa, potentially reversing some of the tissue changes that follow nerve injury.

The existence of vacuum devices illustrates something fundamental about erections: at their core, they are a hydraulic event. The nervous system and the chemistry are there to open valves and close drains, but the final product is pressurized fluid in an expandable chamber. When the biological valve-control system fails, mechanical substitution can reproduce the end result, even if the sensation and spontaneity differ from the natural version.

How the Science Got Here

For most of recorded medical history, nobody understood how erections worked. The ancient physician Galen believed the penis inflated with air, an idea so influential that it dominated medical thinking through the medieval period. Leonardo da Vinci was among the first to challenge this, noting from dissections that the penis of hanged men was engorged with blood, not air. It wasn’t until the eighteenth century that a Swiss physiologist named Von Haller proposed that erections were under nervous system control, and the nineteenth century brought animal experiments showing that stimulating specific nerves caused smooth muscle relaxation in the corpora cavernosa.

The identification of nitric oxide as the key mediator didn’t come until the early 1990s, when researchers demonstrated that blocking nitric oxide synthesis in human erectile tissue virtually abolished the relaxation response to nerve stimulation. That discovery connected the mechanics of erection to a broader revolution in vascular biology (nitric oxide had just been identified as a major signaling molecule in blood vessels throughout the body) and directly led to the development of PDE5 inhibitors within the same decade. The speed from basic discovery to blockbuster drug was remarkably fast by pharmaceutical standards, largely because the underlying mechanism turned out to be clean and specific enough to target with a single enzyme inhibitor.