Some are short and stumpy, others long and lean. The size of a flaccid penis has very little to do with the size it will be when erect. An erect penis holds about 8 times as much blood as one that is not erect. There is much less variation among erect penises than there is among flaccid ones. That means that even though the guy next to you in the locker room is bigger, the two of you are probably the same size when erect.
Erections occur in response to stimulation.
During stimulation, blood flows into the penis, causing the spongy erectile tissue to fill up. The cylinders inside the penis also become engorged with blood and expand against the protective membrane that surrounds them. This compresses the walls of the veins that carry blood away from the penis. The rush of blood in, coupled with the lack of blood flowing out produces the erection. Now that we've sucked the magic out of this, you should know that size does not matter all that much.