The penis is cylindrical in shape and consists of a body, glans penis, and root & within that is the urethra, it is a passageway for the ejaculation of semen and the excretion of urine.
-The body of the penis is composed of three cylindrical masses of tissue, surrounded by fibrous tissue called the tunica albuginea.
-The two dorsolateral masses are called the corpora cavernosa, and the midventral, corpus spongiosum, contains the spongy urethra.
-Skin and a subcutaneous layer enclose all three masses.
-Erectile tissue is composed of numerous blood sinuses lined by endothelial cells and surrounded by smooth muscle and elastic connective tissue.
-The distal end of the corpus spongiosum is an enlarged portion called the glans penis.
-The distal urethra enlarges within the glans penis and forms an opening, the external urethral orifice & the glans is covered by loose skin, prepuce or foreskin.
-The root of the penis is the attached portion. It consists of the expanded posterior continuation of the base of the corpus spongiosum is the bulb of the penis, which is attached to the inferior surface of the deep muscles of the perineum and is enclosed by the bulbospongiosus muscle, which promotes ejaculation.
-The two separated and tapered portions of the corpora cavernosa penis is the crura of the penis, these extend laterally away from the bulb of the penis to attach to the ischium and is surrounded by the ischiocavernosus muscle.
The penis is supported by two ligaments the fundiform ligament arises from the inferior part of the linea alba, and the suspensory ligament arises from the pubic symphysis.
Sexual arouse stimulates parasympathetic fibers from the sacral portion of the spinal cord to initiate and maintain an erection, as these fibers produce and release nitric oxide which then relaxes smooth muscle in the walls of arterioles & blood vessels becomes dilated & more blood can enter. The increased blood flow and widened blood sinuses cause an erection and compressing the veins that drain the penis, which slows down the blood outflow, helps to maintain the erection. Once sexual stimulation has ended, the arterioles become constrict and the smooth muscle within erectile tissue contracts, the blood sinuses becomes smaller thus relieving the pressure on the vein, and the penis returns to the relaxed normal state.
For better understanding, you can also watch this video