For a very long time human beings were defined as the "rational animals".
By this it was meant that we are very apt problem solvers, that we are able to recognize patterns and find the hidden regularities existing beneath the empiric surface of the world.
However, probably due to mainly modern art, that kind of definition isn't so popular nowadays. Imagine advising a contemporary poet to be a rational animal! Moreover, animals are themselves very good problem solvers and thus, from such a viewpoint, the animal/human difference is only quantitative at best.
The focus has changed on claiming that we humans are intentional beings, we have purposes and goals, while the animals are only surviving machines driven solely by causal factors. We act in certain ways because we want certain things. The animals behave in certain ways because they are driven by their instincts. In the same way a bullet does not have the power to choose its target and it is simply bound to go in a certain direction, the animals are supposed to be bound to obey their genetic-inscribed "nature".
If the first view doesn't go well with the artists, the second view doesn't go well with the scientists: A scientist believes a certain theory only if that theory helps him make some real predictions. In this case, a good theory on the inner workings of animals must make us able to predict something about the animal behavior. But the causal theory of animals doesn't predict anything - because the animals are "very complex" machines. However, to a scientist that is simply small talk, it's an empty untestable claim.
Nonetheless, one can predict the behavior of animals by assuming they have goals. For example, one can assume a bird has the purpose of surviving, and thus it builds a nest, and thus it goes around gathering small tree branches and leaves. It is virtually impossible to describe such a behavior in causal terms, i.e. starting from the opposite direction: to assume there is some cause that determines the bird to gather a leave and that there is a cause that constraints the bird to put all its gatherings in the same place in the shape of a nest and so on. One would have to assume countless unseen "causes". It is much simpler to assume the bird has purposes.
Only once we have accepted that the difference between humans and animals does not lie in the contrast between our intentional nature and the animals' causal nature, we can truly understand the real difference.
If one plays hide-and-seek with his or her dog, one finds out a very interesting fact. At first, it seems that the dog understands the game, he understands that it has to find you and it is able to adopt this purpose. His behavior is indeed goal-driven, it has the goal of finding you. However, when you play again and again, you can notice a curious fact: when the dog starts searching for you he always first goes to the same place where you have hidden in the previous game. In other words, the dog does not understand that you yourself have the goal of hiding from it. It thinks that if it has found you there in the previous game you are probably there again. It adopts the goal of finding you, it does not act like a robot with a predetermined behavior, but nonetheless it assumes you are such a robot!
This is a subtle difference first noticed by Robert Brandom: there is a difference between having goals and being able to attribute goals. In other words, there can be unconscious goals. Animals have only unconscious goals, while we, besides having such goals, also have some conscious goals (and we are also able to asign goals to others).
The standard test of detecting consciousness is the mirror test: if an animal manages to recognize itself in the mirror, it means it has a certain awareness of itself. Insofar, the consciousness animals are: humans, chimpanzees, orangutans, gorillas, dolphins and orcas (killer whales).
Using the things said above one can understand why some animals manage to recognize themselves in the mirror while others don't. One does not recognize himself in the mirror because one recognizes the behavioral similarities between oneself and one's reflected image - this is virtually impossible to do because one cannot really observe oneself (we have a very improper perspective). One recognizes oneself in the mirror because one ascribes goals to the person in the mirror and ascribes goals to oneself, and then one can realize that the image has the same goals as oneself - therefore it is the same person.
So, what is consciousness? It is the ability to attribute goals (either to oneself or to others). Whether one has such an ability can be detected via empirical means such as the hide-and-seek game.
What's the Difference Between You and Your Dog?
Understanding what consciousness is by playing hide-and-seek