It could be all the factors so far discussed. Including age and blood pressure and gravity. A cockring will help, as noted.
For sure, if you are laying there thinking about the fact that you are deflating (or anything else non-sexual), you probably will lose your erection.
Grab her ass and grind that thing in deep and focus on the moment. She'll love you for it, too...
