To answer the question I will borrow a quote from neuroscientist and Nobel laureate Gerald Edelman:
The evolutionary advantage is quite clear. Consciousness allows you the capacity to plan. Let's take a lioness ready to attack an antelope. She crouches down. She sees the prey. She's forming an image of the size of the prey and its speed, and of course, she's planning a jump. Now suppose I have two animals: one like our lioness, has that thing we call consciousness; the other only gets the signals. It's just about dusk, and all of a sudden the wind shifts and there's a whooshing sound of the sort a tiger might make when moving through the green grass, and the conscious animal runs like hell but the other one doesn't. Well, guess why? Because the animal that's conscious has integrated the image of a tiger. The ability to consider alternative images in an explicit way is definitely evolutionarily advantageous.