There is another correlation as well. In countries where there is struggle to survive, and where there is a lot of competition for resources, there tends to be a greater belief in god. In countries where many of the basic resources are socialized — free medical, free education — there is very little belief in god. In other words, people who are desperate turn to god because there is no other place to find help, whereas people in welfare states can find help in the material world, and therefore there is no need to seek help from a non-existent entity.