- Errant pattern recognition led to superstition. (When I do X, then Y occurs sometime thereafter.)
- Superstition led to errant agent detection. (Some controlling force or some invisible being makes Y happen when I do X.)
- Agent detection led to empathetic reasoning. (If Y is a good result, the controlling power likes it when I do X. If Y is a bad result, the controlling power doesn't like it when I do X.)
- Empathetic reasoning led to attempts to manipulate or influence the controlling power. (The controlling power likes when I do X, so I will do it again. Or, the controlling power doesn't like when I do X, so I will try doing Z instead.)
- The techniques used to influence the controlling power get formalized/systematized, and a new religion is born.
This is a simplistic model, and there are many other factors to consider in order to broaden the religion from being that of just one person or one family to being the common practice of an entire community, but it seems like the basic mechanics are sound. I could see religion going either positive (a "good" controlling power) or negative (a "evil" controlling power), or both.
Carus presented a different theory, one which was challenging for me to accept:
"Demonolatry, or Devil-worship, is the first stage in the evolution of religion, for we fear the bad, not the good....
....Devil-worship naturally precedes the worship of a benign and morally good Deity. There are at least many instances in which we can observe a transition from the lower stage of Devil-worship to the higher stage of God-worship, and there seems to be no exception to the rule that fear is always the first incentive to religious worship." HOD, P6, Paul Carus
Does religion always begin with fear? We'll take a closer look at that theory as we dive into the History of the Devil.