You're obviously creating more semen than you are ejaculating.
So, it builds up, you release it one night (doesn't even have to be at night)
I've never had one since I started masturbating at like 12. I'm glad. Waking up with cum all inside my boxers = not nice