I think ED will befall most guys during our lifetime. Happen to me when i was late 20s. It just happened. Nearly stress out. But slowly, it just came back to life just as when it just suddenly die off.
Many factors can be attribute to stress. Low confidence in ourself etc. Unexplainable.
For my case, more to stress and "boring" with my missus etc. Actually come to think of it, its really a bad mind game about myself. Because now i yearn so much for my missus, but at that point, when my missus always give me what i want, it becomes a easy sex and less interesting to me to the extend i find it mudane.
But now, as you have guess it, my missus dont give me easily, makes me yearn for her even more.
Its always our mind playing the tricks.
Mind over power bros.