Probably neither. People like to belong to a group where they feel they "belong" and that in itself is sufficient explanation for the spread of religions IMO.
Propagation of societal values and/or fear of hell and/or fear of death assuaged by the assurance of an afterlife and/or being able to rationalize away the vagaries of nature as the will of god(s) are just optimizations after the core system was already invented.