Why do penises erect?

Your penis will become erect if you are sexually aroused. This can happen due to a pretty girl or something like porn.