I think that suffering or going through certain traumatic events reminds us that our physical lives are finite. Even though my mind is aware that I am going to die someday, it doesn't truly hit until I'm at a funeral or watching someone die in front of me. And then you realize that you are going to be that person one day, lying there, knowing that you were going to close your eyes at some point and never wake up.
Then we start to explore the questions of eternity, the afterlife.
I do agree also that people do turn to religion for comfort, because say what you will about any other pleasure or comfort that this earth can give, but it's fleeting. We know this. The term "God shaped hole" is extremely cheesy, but I do agree with the concept. Even those who don't believe in God but want something more -- we have the same urges and desires. We want a source of comfort and peace that will be unchanging and always available to us, regardless of money, marital status, etc.