The body, is not always as willing as the mind.
From talking to other guys, it’s at least an occasional issue, even when you are young and healthy.
Alcohol, or drug use, can effect performance for a male as well.
Most of it, IS in the mind. Many mamals, have an extra-skeletal bone in their penis. A “Baculum,” that provides the “hardness” required for most penetration.
Human males, have to rely on blood flow. As age advances, things can be tricky.
Especially if someone is a little neurotic, they will eventually have some difficulty.
Females, obviously loose some of their ability to naturally produce vaginal lubricant, as they age.
A lot of guys are jealous, that “all a girl has to do is lay there.”
The desire for sex, does not seem to slow at a matching pace, with their hardware.
There is also the fact that it can be very physically exerting, to do the work required.
It’s possible that ED, is not the only problem.
As long as a male has testicles, they will always at least think about sex. I have heard of child molesters, having their testicles removed with the aim of no longer desiring young children. But in most of those cases, the men still had pedophilia after the procedure.