An interesting piece in Science Daily on the evolutionary aspects of humor.
On a related but different note, I have always wondered whether there was more to the familiar movie cliche where someone challenges a king’s authority and the room goes silent, then suddenly the king laughs and everyone follows. The object of laughter is let off the hook, in exchange for looking like he or she was joking – making a fake challenge. The cost of this back down is partial humiliation.
Perhaps the origins of humor are a back down mechanism in potential conflict situations, where one party offers a lack of aggression signal in exchange for humiliation, i.e. being laughed at. In game theory terms, it allows for battles to be won or drawn without physical violence, with the same rules as for conflict, but a lesser cost/benefit of losing or winning.
Obviously, this may just be one facet of humor, but since fighting is such a fundamental behavior common to almost all species, whereas joking is not, I would suspect humor is built upon more ubiquitous traits further down the behavior tree.