I'm gonna try
Erections and orgasms lie at the forefront common ground of the Parasympathetic/ Sympathetic system functioning--in other words bodily functions you control (Like your arm movement) and functions that automatically happen that you can't control (Like your heart rate, or a fever)....They most certainly occur in your brain specifically the hypothalamus for the parasympathetic erection part to the cerebral cortex that prohibits the parasympathetic, and inhibits the sympathetic.
Add to that trauma, severe illness/ stress, injury, shame, guilt, or medications like Dilaudid, plus let's not forget age and Hedonic Adaptation which again is all part of the mental, and what I would assume is what you meant by "destroyed nerves"......93% mental, the rest is enzymes that convert other enzymes that split off into two new enzymes that release potassium smooths relaxes and engorges tissue, or opens up the Urethra and releases semen in the case of ejaculation