Evolving brains produce minds. Minds operate on imaginary entities. Thus they can create what does not exist in the physical world. Spirits can be deified. Perception of spiritual entities is emotional--organic. Spirituality is a part of culture while culture is an adaptive mechanism of human groups as it allows for technology and social organization to support survival and reproduction. Humans are not rational, they are emotional. Most of explanations of the world, offered by various cultures, involve an element of "fiat", a will of a higher spiritual being, or a reference to some ideal. From this the rules of behaviour are deduced. These rules are necessary to maintain social peace and allow a complex unit consisting of individuals of both sexes and all ages to function in a way ensuring their reproductive success and thus survival. There is thus a direct biological benefit of complex ideological superstructure of culture. This complex superstructure most often takes a form of religion in which logic is mixed with appeals to emotions based on images of spiritual beings. God is a consequence of natural evolution. Whether a deity is a cause of this evolution is difficult to discover, but existence of a deity cannot be questioned.