In my case is was circumstance - someone gave me a check and said go build it after I gave a talk about my great idea. I was so ignorant that I didn't even know I was founder.
What I find more interesting is what motivates founders to continue when things get really, really painful. I don't have a good answer.