The penis is a structure similar to a balloon in some ways. When a balloon is relatively empty, it is soft and floppy. When filled with water, it becomes longer, wider and more rigid. The penis is not made of rubber. However, beneath the skin and some nerves and blood vessels is a structure that forms the main substance of the penis and this is called the tunica albuginea. Like rubber, the tunica albuginea can stretch. Within the tunica albuginea is sponge like vascular tissue.

Penile-cross-section-anatomy
Illustration of the anatomy of the penis. During an erection, blood enters the corpora cavernosa.

During an erection, more blood enters this sponge like space, causing the tunica albuginea to expand, and the penis to become longer, wider, and more rigid. Like all structures in the body, arteries bring blood (and oxygen) to the penis, and veins take the blood away. The penis, when flaccid (not hard) has blood inflow and blood outflow – blood entering the penis through arteries and leaving the penis through veins. During an erection, the blood enters the penis faster and the veins pinch off (occlude) causing the tunica albuginea to expand. In a way, the penis is like a sink with a faucet and drain. The faucet is always on (not full force) and the drain is open. An erection is in a way like turning up the flow from the faucet and plugging the drain.In simple terms, an erection happens because the brain tells nerves to release a substance in the penis. That substance then causes sponge like tissue of the tunica albuginea to change in a way that leads to more blood entering the penis and less blood leaving the penis, causing an erection. Often, patients with erectile dysfunction have a vascular impairment.