Your penis is like a hydraulic pump. When there is enough fluid (blood supply) in the pump, it will lift up. The more fluid (blood supply) being pumped to the penis, the higher and stronger it can lift up. If little blood supply is pumped to the penis, it will still be soft and cannot lift as well.
Corpus cavernosum is the part of the penis that is spongy in nature, like a sponge that can retain fluid and be drained repeatedly. This is the main part involved in the hardness and size of your penis.
The erection begins when the arteries open up as the smooth muscles of the vessel walls relax. The veins which drain the blood then close down and prevent blood from leaking out. A man must have an adequate blood pressure to carry blood into the penis, and can have no leaks in the veins of his penis that will allow the blood to escape.
The nerves are the control mechanism which coordinates the increase in pressure in the penis as well as the closing down of the veins. A man needs sufficient levels of testosterone in order to have the desire, feel aroused, and to get an erection.
Any physical or emotional factor that affects a man's arteries, veins, nerves, or hormones can impact his erections. A man must allow himself to relax in order for the blood vessels of the penis to also relax so that he can get and maintain an erection.