It is not by accident that a person coughing or choking is frequently thought to be a person having a good laugh. Likewise the start of a hearty laugh is often mistaken for a shout or sneeze, and the rhythm of laughing is similar to the heaving rhythm of sobbing. Do these similarities mean that laughter has a physiological basis with sobbing and coughing or a defensive bark? They do indeed. An analysis of situations found humorous invariably uncovers a tense situation. In fact, to discern why one person finds a situation funny while another does not, look to why the amused person is experiencing tension. Muscles tensed without relief naturally begin twitching and cramping, a result of the buildup of toxins in the muscles but also due to the evolution of effective relaxation methods. Those creatures that cramped without release did poorly, and those that twitched into a different state survived. Thus laughter or sobbing or barking - a tension release.
Socialized humans given to denying their hostilities excuse their laughter as benign, which of course in the main it is. If they weren't laughing they might be murdering each other or endlessly fighting, so laughter is encouraged. When there is nothing one can do about it - joke around. Situations of intense jealousy bring forth sarcasm, which is hostility thinly veiled as humor. If someone else gets the promotion, joke around about his qualifications in a semi-sarcastic manner, and you might get away with throwing him a verbal punch. If you have a dominating wife who insists that the doors be opened for her as though she were a helpless queen, the thought of someone like her dropping her parcels when the doorman gets distracted and lets the door smack in her face allows the fuming husband to do this to his wife, by proxy. Humor is thus an effective safety valve for hostility that would prove disruptive, and can even be used to deflect antagonism from others. Oops, the jokes on me.