Morpheus,
The data suggests correlations to both. Researchers identified the correlation between intelligence and a lack of religiosity nearly a century ago; this is nothing new and easily googled. What the data suggests is that contributing factors to secularism and atheism are: intelligence, a rational personality, education, prosperity, culture. However, if prosperity is factored out, intelligence, rational personality and education will still be factors correlating to secularism and atheism. If education is factored out, intelligence and a rational personality will still be factors.
In other words, intelligence and personality (rationals who primarily make decisions based on an analytical, thinking process), based on a lot of studies, seem to be primary drivers of whether someone is religious. Most of us already intuitively know this. Intelligent people who rely or make decisions primarily on their feelings are more likely to be religious. That isn't surprising either; believing is one step up from Emotions, which is the lowest rung on our evolutionary ladder. Feelings are all that are required to believe.