As the muscles around the corpora cavernosa relax, the corpora cavernosa fill up with blood. When the corpora cavernosa trap the blood, they expand and the penis becomes firm and elongated. This results in an erection.