It can be both, but most often the cause is physical. A firm erection is the result of a whole series of psychological and physical events. If a problem occurs at any step in the process, the erection may be absent, insufficient or short-lived. There is therefore a range of possible causes of erectile disorder.
These can be grouped into two general types: physical (related to the blood vessels and/or nerves) and psychological. Most erection problems are due to a combination of these factors. Until the early 1990s, most cases of erectile dysfunction were thought to be of psychological origin, but new research has shown that the causes are physical in 85 to 90% of cases.