The penis is made up of spongy tissue that holds blood. When the penis is flaccid (soft), blood flows in and out of the tissue. During sexual excitement, extra blood flows into the tissue. The extra blood makes the tissue swell. The penis then becomes erect (rigid). This makes it firm enough for intercourse.
Physical or psychological problems can keep the tissue in the penis from filling with extra blood or from holding the extra blood in. When this happens, the penis remains soft. Or, the penis gets hard but won’t stay hard. This is called erectile dysfunction.