On the materialist view, consciousness is considered an
epiphenomenon. That is, it is a causally inert by-product. (To argue otherwise is to presuppose free will and therefore dualism.) So, this raises the question: Why was consciousness naturally selected?
I do not have the slightest idea if this is true, by which I mean this is entirely my own opinion cobbled together from what I've read on the subject, and it should not be treated as the words of someone who works in the fields that deal with it;
I think consciousness is just a matter of how 'powerful' your brain is, from a mechanical standpoint. Namely that once you reach a certain brain-to-body-mass ratio, consciousness starts to pop up more and more. I say that because generally speaking, the other animals that are as smart as we are tend to have similar sizes in that regard. Chimps, elephants, dolphins and so on. So it isn't so much
consciousness that is naturally selected as much as it is a result of attaining X level of intelligence and thus stacking the odds in your favour from a survival & breeding point of view. You would inherently out-compete most other creatures, even those of your own species who were not-quite-conscious. And because of that, it stands to reason that it would be passed on more readily.
It wouldn't be a significant difference at first, your 'level' of consciousness, but it would keep on happening until you reached a threshold and attain what we'd consider the modern human brain. Not merely brain
size but also wiring and what have you. Our brain
size has been rather constant for a very long time, so I think it's fair to conclude that it is likely that it isn't just the ability to store lots of information, but the ability to cross-reference it at higher and higher speeds. This gives you a further edge. Wash, rinse, repeat until you're where we are now.