Cats tend to hide when they are very sick or injured, as an instinctive reaction to avoid being exposed to potential predators. Do they know they are going to die? Perhaps they do, but perhaps they are not as aware of it as we are.
Many animals experience pain at the death of another, but perhaps they do not intellectualize it to the same level as we do, perhaps in a more primitive way. It is not in an animal's best interest to be depressed about the death of another, it should focus on survival. An animal does not want to be depressed by the death of another animal, it should focus on survival. Humans, on the other hand, no longer focused on survival, developed more intellect.
These are interesting issues that still do not have definitive answers. Best regards!