I think its a combination of mental state, personal physiology, age and body chemistry. Some of it you can affect by choice and behavior, some you cannot.
When I was young I had a difficult time controlling my erections and they were a constant potential source of embarrassment. 35 years later, I have to put some effort into maintaining a 100% hard-on.
Part of that may be due to so much PE. Its just tired.
I’ve always been a fast cummer during sex, and learned how to control that to some degree. But what I mainly learned was that my ability to maintain an erection and continue intercourse after a climax is attributed to the amount and level of arousal - both physical and mental. If I jump right into sex without much foreplay, I don’t last very long, and my erection subsides quickly after climax.
If I spend lots of time with physical arousal and getting mentally turned on, my erections are better and longer lasting.
Its rare, but I have at times been able to climax inside a woman and just continue on for another round. I was just more turned on and into the woman than usual.
Or if I was edging to porn for a couple hours, I could climax 3 times without a refractory period. That was a result of intense mental arousal, and lots of sustained physical arousal.
My suggestion to those that cum quickly and have long refractory periods is to spend lots more time in foreplay and getting mentally aroused.
Have your partner stroke or suck you for 5-10 minutes, just getting you super rock hard.