If this question is asked of consciousness without saying what consciousness is doing such that if you took it away then you would have nonsense, then I do not see how anyone can answer it.
The way the question is framed up, consciousness accomplishes nothing as far as survival goes. "evolution could have produced zombies instead of conscious creatures – and it didn’t" Zombie seems to be defined as: phenomena that you think has consciousness but does not.
If consciousness has been defined as some phenomena where you have an intuitive understanding of what is being communicated by that word "consciousness" but also it (consciousness) does not do anything, then how can anyone explain why consciousness should be? Anything you can think of as a function of consciousness, can then be hand-waved as able to be accomplished by zombies.