>evolutionarily unnecessary
Grieving is an evolved response to nomadic group species, so we didn't leave useful or closely related members behind; In their absence we feel compelled to 'search' for them, or be near their carcass. Its interesting how this evolved impulse has been adapted into ritual by our developing ability to understand mortality; But its not really special in any self-awareness kind of sense.
See https://en.wikipedia.org/wiki/Animal_consciousness
We have empirical tests of self-awareness including the Mirror Test as well as observational studies including seeing whether a certain species displays grieving when its loved ones pass (which is evolutionarily unnecessary but is meaningful emotionally).