The religions of complex societies seem to be quite different from those of primitive societies. In particular, these religions of the complex societies have gods that require worship and appeasement. Moreover, they form much of the social glue that hold societies together. New evidence from archeology clarifies how this process occurred. Via Tyler Cowen, this National Geographic article by Charles C Mann lays out the case that organized religion predated agriculture:
Göbekli Tepe, to Schmidt's way of thinking, suggests a reversal of that scenario: The construction of a massive temple by a group of foragers is evidence that organized religion could have come before the rise of agriculture and other aspects of civilization. It suggests that the human impulse to gather for sacred rituals arose as humans shifted from seeing themselves as part of the natural world to seeking mastery over it. When foragers began settling down in villages, they unavoidably created a divide between the human realm—a fixed huddle of homes with hundreds of inhabitants—and the dangerous land beyond the campfire, populated by lethal beasts.
French archaeologist Jacques Cauvin believed this change in consciousness was a "revolution of symbols," a conceptual shift that allowed humans to imagine gods—supernatural beings resembling humans—that existed in a universe beyond the physical world. Schmidt sees Göbekli Tepe as evidence for Cauvin's theory. "The animals were guardians to the spirit world," he says. "The reliefs on the T-shaped pillars illustrate that other world."
This conceptual shift plausibly gave birth to agriculture, civilization, science, and technology. An interesting story, including some climate change.