The emergence of religious behavior by the Neolithic period has been discussed in terms of evolutionary psychology, the origin of language and mythology, cross-cultural comparison of the anthropology of religion, as well as evidence for spirituality or cultic behavior in the Upper Paleolithic, and similarities in great ape behavior.
Humanity’s closest living relatives are common chimpanzees and bonobos. These primates share a common ancestor with humans who lived between six and eight million years ago. It is for this reason that chimpanzees and bonobos are viewed as the best available surrogate for this common ancestor. Barbara King argues that while non-human primates are not religious, they do exhibit some traits that would have been necessary for the evolution of religion. These traits include high intelligence, a capacity for symbolic communication, a sense of social norms, realization of "self" and a concept of continuity. There is inconclusive evidence that Homo neanderthalensis may have buried their dead which is evidence of the use of ritual. The use of burial rituals is thought to be evidence of religious activity, and there is no other evidence that religion existed in human culture before humans reached behavioral modernity.
Elephants actually demonstrate rituals around their deceased, which includes long periods of silence and mourning at the point of death and a process of returning to grave sites and caressing the remains. Some evidence suggests that many species grieve death and loss.
In this set of theories, the religious mind is one consequence of a brain that is large enough to formulate religious and philosophical ideas. During human evolution, the hominid brain tripled in size, peaking 500,000 years ago. Much of the brain's expansion took place in the neocortex. This part of the brain is involved in processing higher order cognitive functions that are connected with human religiosity. The neocortex is associated with self-consciousness, language and emotion. According to Dunbar's theory, the relative neocortex size of any species correlates with the level of social complexity of the particular species. The neocortex size correlates with a number of social variables that include social group size and complexity of mating behaviors. In chimpanzees the neocortex occupies 50% of the brain, whereas in modern humans it occupies 80% of the brain.