New thinking says longer ago than you might think—with implications throughout the animal kingdom:
If [Attention Schema Theory (AST)] is correct, 300 million years of reptilian, avian, and mammalian evolution have allowed the self-model and the social model to evolve in tandem, each influencing the other. We understand other people by projecting ourselves onto them. But we also understand ourselves by considering the way other people might see us. Data from my own lab suggests that the cortical networks in the human brain that allow us to attribute consciousness to others overlap extensively with the networks that construct our own sense of consciousness.
Maybe partly because of language and culture, humans have a hair-trigger tendency to attribute consciousness to everything around us. We attribute consciousness to characters in a story, puppets and dolls, storms, rivers, empty spaces, ghosts and gods. Justin Barrett called it the Hyperactive Agency Detection Device, or HADD. One speculation is that it’s better to be safe than sorry. If the wind rustles the grass and you misinterpret it as a lion, no harm done. But if you fail to detect an actual lion, you’re taken out of the gene pool. To me, however, the HADD goes way beyond detecting predators. It’s a consequence of our hyper-social nature. Evolution turned up the amplitude on our tendency to model others and now we’re supremely attuned to each other’s mind states. It gives us our adaptive edge. The inevitable side effect is the detection of false positives, or ghosts.
And so the evolutionary story brings us up to date, to human consciousness—something we ascribe to ourselves, to others, and to a rich spirit world of ghosts and gods in the empty spaces around us. The AST covers a lot of ground, from simple nervous systems to simulations of self and others. It provides a general framework for understanding consciousness, its many adaptive uses, and its gradual and continuing evolution.
The author makes a strong argument that many vertebrates, including canids and corvids, have consciousness as we understand it, just so they can make sense of the world. It's an intriguing theory.
Note, also, that both the article and I use "theory" in its scientific sense: a hypotheses repeatedly tested and not yet falsified.