A few years ago, I attended a conference at the International Centre for Arts (ICA) in London. At this conference, were two sets of speakers, who had been invited in order to put opposing points of view. Until that day, I had never thought of myself as being in a "camp" with regard to evolutionary psychology. I had just thought of myself as someone who knew more about it than most. After that day, I had in my mind defined an "us" and a "them".
One speaker was a social scientist, and a one of such rudeness, such arrogance, and such jaw-dropping ignorance, that I was quite astounded. At one point, this person spoke with heavy scorn about evolutionary psychologists who believed that emotions all had functions. "I can't see the function of grief," said the social scientist, and left it at that. Presumably the speaker imagined that the audience would conclude that because a qualified social scientist could not think of a function for grief, then there must be none. In fact, grief is one of the easiest emotions to explain.
Here are two functions of grief, both of which strike me as highly adaptive.
1. To prevent the loss of a relative, or ally.
Relatives have your genes in them, and so should not be lightly lost, and allies help you spread your genes, and so too should be valued alive. If you know that you would feel grief if you were to lose a certain person, then you will avoid the pain of grief and so prevent their death if you can. A simple example is a mother, knowing that she would feel grief were one of her children run over by a car, who forbids her children to play in the street. She does not need to lose one child and actually experience the grief for this to be a motivation. She only has to be able to imagine how she would feel. This, in turn, I believe, is why people, especially nurturing types like mothers, enjoy sad stories. Nature has equipped them with a way to rehearse bad feelings in a harmless way, so that they are useful even if not experienced "for real" (see my theory on tragedy)
2. So that we instinctively show ourselves to be good allies.
In order that we may make and keep allies, it is good to show grief at the loss of one ally, so that others of our surviving allies see our grief, and thus learn what a true ally we are. If my best friend lost a close friend of his and just said "C'est la vie" and carried on as usual, I would get the impression that he probably didn't care much about me either, and so could not be relied upon were I to have a crisis. I would seek a better friend. Grief, being an involuntary emotion, forces us to show what good allies we can be. Humans cannot be relied upon to fake this sort of thing convincingly.
The emotion of grief evolved. We know this because we today are all capable of feeling it. It is in us, innate. No one teaches us how to feel grief. It has become a human universal because it is very useful. People of the past who felt no grief did not become our ancestors. They didn't look after their children, and they didn't forge strong alliances.
Of course, this knowledge doesn't make grieving people feel okay again. If it did, it would take away the value of the grief. Grief needs to hurt in order to work.