Gil Greengross reviews Rod Martin’s Psychology of Humor: An Integrative Approach in Evolutionary Psychology (you just know that sexual selection is going to be in there):
Due to the complexity of the topic, it is not surprising that hundreds of theories, varying in specificity, have been offered to explain humor. Evolutionary explanations are no exception. Although it is widely accepted that humor has an evolutionary origin, how it evolved and what evolutionary purpose it served is far from clear and is heatedly debated (Gervais and Wilson, 2005; Polimeni and Reiss, 2006). No one has yet proposed a comprehensive theory of humor, and a unitary theory may not even exist, as different aspects of humor may have different origins and purposes.
Take, for example, one of the most common explanations for the adaptive function of humor, known as the “false alarm” theory. The idea gained recent popularity after it was put forward by the famous neuroscientist Ramachandran, although it was known for at least two decades (Chafe, 1987; Ramachandran, 1998). This theory holds that when facing an ambiguous event, laughter serves as a signal to other members of the group that the perceived threat or anomaly is in fact unimportant. Using a stereotyped vocalization such as laughter helps others to determine the non importance of the event. Thus, they should not allocate energy towards it. Whereas this theory has intuitive value and can explain certain aspects of humor (for example, why laughter is contagious), it is not hard to find examples that do not quite fit. One of the open secrets among humor researchers is that most laugher comes in response to trivial comments. Despite the tendency to focus on analyzing jokes, they comprise only a small portion of what humor is. Thus, the importance of humor in a social context goes far beyond the narrow definition that the “false alarm” theory seeks to explain.
But the social aspect of humor is only one lens through which it can be viewed. As Martin notes, a complete understanding of humor also involves developmental, cognitive, personality and other aspects as well.