I've only had it happen to me once, but I would say the 3 main factors were:
>Being extremely horny
>Being very tired
>Being very uncomfortable
Like I said, it only happened to me once when I was around 13, on a camping trip with my family, horny beyond belief, and unable to masturbate because the motion could move the trailer. I must have drifted off, but I remember begging/praying for some relief and, to my delight, feeling a petite hand wrap around muh dick and give me one of the best handjobs I've ever had. and it ended before I came.