Well, I think maybe this sort of thinking, that there must be "an answer" to which preceded which, to maybe be a little nonsensical to ask.
I mean, the question "makes sense" in the asking, but I don't think it's something to which you get a real answer. It's like asking if environment precedes genetics, but genetics only exists in the environment. So, while it is sort of "trivially true" that one of them must have "came first" the answer is, maybe, one, unknowable and two, possibly, not explanatory of anything in reality.
To me, it would seem more that they are relational sorts of principles. The capacity for "religious thinking" was either latent or basally existent. Technology and/or environmental factors placed a sort of pressure on humans which caused that latent, or simply unused capacity, to become more relevant/necessary.
So, I don't know that it makes too much sense to wrack our minds to ask if the pressure made the capacity, or if the capacity allowed the response to the pressure. The answer, I'd guess, is simply "yes."