The list of possible reasons is quite long, but no one really knows!
1. The brain is busy with something else.
During REM sleep, some areas of the brain are at rest, and the penis can behave as it wants.
2. Hormones are to blame
In the mornings, the level of testosterone in the male body is high, after 40-50 years it begins to decline.
3. Penis exercise
The body “teaches” the member to retain blood for a while. Other parts of the body cannot do this: if you tightly tie a rope around your leg and remove it after half an hour, there may be problems with blood flow.
4. There was external stimulation
The owner himself touched the penis in a dream, or the partner moved too close – and the penis reacted accordingly.
5. Nobody needs to go to the toilet
Most likely, this is just a coincidence, and not at all the prevention of nighttime embarrassment in bed: the kidneys cope with this much better. In addition, given that the clitoris can swell at night in women, the version of the connection between erection and urination becomes even less likely.