Joel Warner covers one professor's attempt to nail it down:
The ultimate takeaway of [Peter] McGraw’s paper was that the evolutionary purpose of laughter and amusement is to “signal to the world that a violation is indeed OK.” Building on the work of behavioral neurologist V. S. Ramachandran, McGraw believes that laughter developed as an instinctual way to signal that a threat is actually a false alarm—say, that a rustle in the bushes is the wind, not a saber-toothed tiger. “Organisms that could separate benign violations from real threats benefited greatly,” McGraw says