Philosopher
John Morreall theorizes that human laughter may have its biological origins as a kind of shared
expression of relief at the passing of danger.
For example, this is how this theory works in the case of
humour: a joke creates an inconsistency, the sentence appears to be not relevant, and we automatically try to understand what the sentence says, supposes, doesn't say, and implies; if we are successful in solving this 'cognitive riddle', and we find out what is hidden within the sentence, and what is the underlying thought, and we bring foreground what was in the background,
and we realize that the surprise wasn't dangerous, we eventually laugh with relief. Otherwise, if the inconsistency is not resolved, there is no laugh, as
Mack Sennett pointed out: "when the audience is confused, it doesn't laugh" (this is the one of the basic laws of a comedian, called "exactness"). It is important to note that the inconsistency may be resolved, and there may still be no laugh. Due to the fact that laughter is a social mechanism, we may not feel like we are in danger, however, the physical act of laughing may not take place. In addition, the extent of the inconsistency (timing, rhythm, etc) has to do with the amount of danger we feel, and thus how intense or long we laugh. This explanation is also confirmed by modern neurophysiology.
--
http://en.wikipedia.org/wiki/Laugh