Some general (meta-?)comments, in light of the most recent trio of posts above ...
I've long considered it misguided to treat the subject of 'religion' as addressing a human activity or interest that's always been framed, conducted, and managed in a single manner - much less the manner in which we know it today.
It's also been apparent to me that so-called 'primitive religions' aren't so much tentative or rudimentary versions of current and currently-defined 'religions' as relict evolutionary precedents for the underlying motivations, concept, organization, and practice of what we call 'religion' nowadays.
IMHO a big part of the problem is terminological. The term 'religion' (from the Latin for 'obligation; bond; reverence') implies adherence or commitment to something abstract. I believe these themes arose during the course of the evolution cited above, and they shouldn't be considered innate components of this human activity's earliest forms.
So here's a very condensed and sketchy sketch of how I see it ...
My personal hypothesis is that it all started with mythic / folkloric explanation for the world itself and the phenomena encountered in basic survival activities. In its general sense of 'knowledge', I consider such explanatory lore to have been the 'science' of its day.
The most important theme in such lore concerned whatever agency lay behind states of affairs or observed changes. Simplicity and universality in such lore required some degree of generalization, which in turn motivated explanations that were abstracted from the tangible objects and occurrences they explained.
The initial format for such abstractions were the animistic agencies (e.g., 'spirits' in the broadest sense) associated with particular objects or classes of objects. Over time there was a progressive refinement in the descriptions of such agencies, combined with a progressive consolidation of these agencies' espoused forms into fewer and fewer types.
One such trend was the refinement of vague agencies into forms associated with those objects that exhibited agency themselves - i.e., animals (humans included). As the apparent sophistication of decisions ascribed to such agencies increased, the agencies were progressively portrayed as exhibiting human qualities (e.g., 'homocentric animism').
By the time agriculture and city-states arrived, the agencies were typically portrayed as a pantheon of human-like figures. It was around this time that formally institutionalized religion arose as a corollary component of the mass power structure necessary to stabilize and regulate the increasingly interdependent population (cf. Cochise's query).
The next phase involved expanding the scope of concern from natural events and phenomena to the individual / personal context. In large part this involved a thematic shift from 'how the world does work for all of us' to 'how you personally should behave'.
I have no opinion as to when this started, but in the West I definitely believe it culminated in the monotheistic religions we know today. This culmination represented the ultimate consolidation of abstracted agency and the ultimate 'hooks' into each individual's personal life and psyche. It was by this time that personal apprehension about one's own death probably became a widespread motivation for religious adherence (cf. CN's query).
In the East, developments didn't progress in the same way or through all the phases mentioned for the West once the settled city-state context was attained.
Throughout this course of events, elements of the earlier forms were either absorbed into the later forms or spun off as alternatives or curiosities to be tolerated, decried, or oppressed. Animism and its proactive praxis of shamanism survive, sometimes in reframed or reinterpreted guise. The societal power structure elements survived to mold much of Western history (and plague us still). The personally-focused elements persisted as a sure-fire attractor and proliferated laterally into quasi-religious beliefs and pursuits (e.g., New Age spirituality).