The earliest religion? Well, strip all religion away. Start there.
Early humans with no conception of forces above or beyond their own. But wait! Humans, even, presumably, early humans, had brains designed to deal with entities. Entities with motives, designs, schemes, and secrets. We needed to, indeed, for otherwise we would never have been able to live in any sized tribe, let alone ones with more than ~120 members. I would suggest that our need to solve problems and deal with other self-entities led to us accepting that the wind was a self-entity. And so was the sun. The moon. Trees, rocks, mountains, caves, everything.
Eventually, we invented higher self-entities that controlled lower self-entities. In many cases, the higher self-entities replaced the lower self-entities.
We thought that by dealing directly with the self-entities of the world we could help our chances of survival. After all, if you think that the sky is a being, than you would indeed ask it to rain for you, to provide you with sustenance. If it did not, perhaps it just hasn't gotten what it needs from you. Thus, proto-sacrifice, proto-prayer, and other such concepts.