Speculative hypotheses about the evolutionary functionality of laughter
The common denominator of all jokes is a path of expectation that is diverted by an unexpected twist necessitating a complete reinterpretation of all the previous facts — the punch-line…Reinterpretation alone is insufficient. The new model must be inconsequential. For example, a portly gentleman walking toward his car slips on a banana peel and falls. If he breaks his head and blood spills out, obviously you are not going to laugh. You are going to rush to the telephone and call an ambulance. But if he simply wipes off the goo from his face, looks around him, and then gets up, you start laughing. The reason is, I suggest, because now you know it’s inconsequential, no real harm has been done. I would argue that laughter is nature’s way of signaling that "it’s a false alarm." Why is this useful from an evolutionary standpoint? I suggest that the rhythmic staccato sound of laughter evolved to inform our kin who share our genes; don’t waste your precious resources on this situation; it’s a false alarm. Laughter is nature’s OK signal.
That is from V.S. Ramachandran’s A Brief Tour of Human Consciousness.