The evolutionary psychology of religion is the study of religious belief using evolutionary psychology principles. It is one approach to the psychology of religion. As with all other organs and organ functions, the brain and cognition's functional structure have been argued to have a genetic basis, and are therefore subject to the effects of natural selection andevolution. Like other organs and tissues, this functional structure should be universally shared amongst humans and should solve important problems of survival and reproduction. Evolutionary psychologists seek to understand cognitive processes, religion in this case, by understanding the survival and reproductive functions they might serve.
Nonhuman religious behavior 
Humanity’s closest living relatives are common chimpanzees and bonobos. These primates share a common ancestor with humans who lived between four and six 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 evidence of religious activity, but there is no other evidence that religion existed in human culture before humans reached behavioral modernity. 
Marc Bekoff, Professor Emeritus of Ecology and Evolutionary Biology at the University of Colorado, Boulder, argues that many species grieve death and loss. 
Setting the stage for human religion 
Increased brain size 
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.
Robin Dunbar argues that the critical event in the evolution of the neocortex took place at the speciation of archaic homo sapiens about 500,000 years ago. His study indicates that only after the speciation event is the neocortex large enough to process complex social phenomena such as language and religion. The study is based on a regression analysis of neocortex size plotted against a number of social behaviors of living and extinct hominids. 
Stephen Jay Gould suggests that religion may have grown out of evolutionary changes which favored larger brains as a means of cementing group coherence among savannah hunters, after that larger brain enabled reflection on the inevitability of personal mortality.