The origin of ideology and religion (of hunters and gatherers)
To reproduce a human community must reproduce physically. This is done through sex and food production, heating, clothing, tools, education, medical care and so on. In humans there is – in contrast to other species – a new essential category that was added: ideology. We define ideology as the whole of human ideas. To reproduce himself man must also reproduce ideologically.
Girl of the Andaman Islands, with her sister’s skull on her back, an aspect of the ancestor cult
Ideas are generated by the brain. They also exist in animals. Man has a special feature, unlike other animals, his ideas can be expressed by spoken language. When that occurred, is not certain. It was probably a long process, that may have taken a few million years. One of the conditions was that the man or his predecessors were walking upright so that their larynx came down, a necessary condition to produce spoken language. Footprints of australopithecines of 3.7 million years old from Laetoli, Kenya, indicate that the ancestors of humans already walked upright.
A second condition was the growth of the brain. The brains of human ancestors grew significantly from about 3 million years ago. This growth lasted until about 30,000 years ago. From then on there is even a small decrease in the average brain volumes.
Where does ideology fit in human biology and human society?
Ideology should also be (re)produced
Man is an animal, but an evolved animal. Mammals reproduce themselves by reproduction through sex and food. For mankind this is not enough. It should also reproduce its ideology. This is necessary because since man has spoken language he cannot realise his high level of productivity without his consciously reproducing ideas (technology, society, education, morality, etc.) After a long development, human communities, clans, could not acquire food any more without the knowledge they had acquired. This is well explained in an article by Kaplan, Hill, Lancaster, and Hurtado.  It are human communities that reproduce. The reproduction of ideology is part of that reproduction.
Ideology consisted of various ideas: clanic, totemic, exogamous, moral, educational, philosophical, aesthetic, legal, technical, religious and so on. A human community (re)produces by material production (hunting, gathering, making equipment and other goods), biological production of humans and ideological production.
Religious ideas are social ideas, they are part of human ideology. The ideology of a clan of hunters and gatherers was an essential part of the reproduction of that community. Man was no ordinary animal. In order to reproduce his life he had to pass on much knowledge in a long learning process. The collective wisdom of a community was given further through ideas. Ideology was and is a productive force, but it was and is not without contradictions. Some aspects of ideology (human sacrifice) are counterproductive just as are some tools (nuclear bombs, torture instruments, drugs, etc.) or may be counterproductive.
Religion as a social phenomenon is part of the ideology of human communities.
The main objective of human communities to (re)produce. An important aspect of ideology is that it provides significantly to the cohesion of the clan.
The extensive knowledge of hunters and gatherers
Hunters and gatherers built over more than 2 million years an extensive knowledge in various fields, from surgery over astronomy to mathematics, zoology, botany, engineering and so on. The overview on the following alineas only a lights a tip of the veil.
The place of religion in the (re)production of man
Once man could speak a process was put in motion in which hunters and gatherers became- very slowly – aware of their situation. A process that would involve all aspects of human life. Children, grandchildren resembled their parents and grandparents. Man became conscious of the fact that his clan was reproduced through the clan members. He believed that the soul, the life of an ancestor was reborn in a new born child of the clan. The concept of the soul/life was developed to give this continuity a name. A soul of man was reborn again and again. It would be wrong to see in this concept just the supernatural aspect. For hunters and gatherers this was reality.
These ideas of the early man reflected reality: the human clan, human communities reproduce themselves. Not bad, tens or hundreds of thousands of years before the laws of heredity s and genetics scientifically substantiated this.
These religious concepts were in their entirety a partially adequate and partially inaccurate reflection of the life of hunters and gatherers. They are still believed by a majority of people today.
Man was also aware that he was dependent for his food of the reproduction of animals, plants and nature in general. Totemism was in its origin a hunting ritual that was meant to insure the multiplication of totems (mainly animals and plants). Man probably projected his concept of the human soul on animals and plants. His totems had a soul and reproduced, just like human communities did.
Part of the cost of religion was that people were regularly uselessly killed by each other because they believed in the imaginary influence of evil spirits or souls. Religion was, also in this respect, a reflection of society. Clans had friendly relations with some clans but hostile relations with other clans. Murder and war between clans was endemic in some areas. Chimpanzees, especially male chimps have basically hostile relations with all neighboring clans. Man had gone a long way since the split with chimps. Members of the same clan had to assist each other in good and bad times. Totemism gave man another axis along which people had to help each other in difficult times. This extended form of cooperation was an important change in human evolution and a step in the process of becoming conscious for the species.
 Hillard Kaplan, Kim Hill, Jane Lancaster, A. Magdalena Hurtado, A Theory of Human Life History Evolution: Diet, Intelligence, and Longevity, Evolutionary Anthropology, 9, 2000.
 Bethel or betelpeper is an herb with medicinal properties.
Sir Edward Burnett Tylor, Religion in Primitive Culture, Second Volume of Primitive Culture, John Murray, London, 1871 (1873, 1899), p.43.
 Marc Vermeersch, The history of man. Part I, Hunters and gatherers. Book 2, the society of hunters and gatherers, p.380-382.
Summary. Richard Dawkins asked the right question on the origin of religion: what is the biological benefit of religion? Marc Vermeersch thinks that religion cannot be understood in itself but only as a part of human ideology. The development of human ideology was an evolutionary advantage. It was useful for the reproduction of man. At a point in man’s history human ideology had to be (re)produced. The oldest religion of man, ancestor cult, had many aspects, one of the most important was that it gave the reproductio of human knowledge, the knowledge of the elders, a place. The origin of religion cannot be understood in itself. Relgion is part of human ideology en human ideology is an essential part of human reproduction.