The use of humor is universally recognized as a means of relaxing tensions.
Mark Twain said humor arises from sorrow; that ‘there is no laughter in heaven.’
All humor is enjoyed at the expense of others, but for the one exception of puns.
My idea is that humor may be a cultural response to the natural law of the wild to prey on the weak and vulnerable. When early humans began to experience the benefits of complex socialization, victimizing the weak became less acceptable, and humor, with its tendency to exploit an unsuspecting innocent, may have been substituted.
Self-deprecating humor is widespread throughout the world. Perhaps it serves a general purpose, signaling an innocuous form of bonding within an increasingly complex social hierarchy. Or maybe it is an instant way of demonstrating meekness in order to avoid an abusive encounter.
Still, early hominids must have found something to smile about. Perhaps millions of years ago a form of proto humor existed, similar to proto language.
Consider humor in music. Why is it so difficult for pure music (without the help of narrative) to represent humor, compared to other art forms? There are notable exceptions, including the Haydn ‘Surprise’ Symphony, PDQ Bach, and intentionally singing out-of-tune.
Non-programmatic music, by its nature, is abstract and personal; there is little to convey with humor.
Perhaps humor may be absent exactly because music is not enjoyed at the expense of others.