Why is it hard to pee when men are erect?

it is hard to pee when erect because their is a valve in the Male Reproductive system that automatically blocks urine from coming out when Ejaculation happens it is just a natural thing the Male body does to prepare for sex.