Here’s a fascinating video in which Australian philosopher of mind David Chalmers discusses the utter superfluity — from an evolutionary perspective — of consciousness. His point is that as far as natural selection is concerned, we could have evolved as highly effective automata or zombies, operating strictly on instinct without the phenomenally rich gift of being conscious of ourselves added to that.
There’s nothing about consciousness, as compared to the zombie model, that gives a creature an additional benefit in passing along its genetic legacy to descendants. In that sense consciousness is superfluous and therefore devilishly hard to explain as a product of unguided evolution. Where then did it come from?