In "The Origin of Consciousness in the Breakdown of the Bicameral Mind," Jaynes argued that human consciousness developed about 3000 yrs ago, with the Greeks. Before then, he proposes that the Egyptians and Babylonians couldn't tell the difference between reality and hallucinations. Dreams, for ex., were real to them, and they believed gods were actually talking to them in the heads.
I don't recall his argument for how it happened for the Greeks (though I totally disagree). But, the interesting part is about the function of the bicameral brain. One of the things lsd does is to chemically separate the left and right lobes. So, an argument could be made that hallucinogens allow a mind to look at itself, a temporary reflection. After the trip, however, we remember what we're not, and distinguish between reality and imagination.
One problem is that primates and other animals have dined on shrooms since they've co-existed. Otoh, there are still those who believe that dreamtime is a reality, and that gods speak to them/people.
We don't know that horses have religion; but, if they did, god would have hooves, a tail, and whinny.