I think we already have a good idea why humor is funny. In our closest primate relatives, chimps and bonobos, who also laugh (i.e., the chimp equivalent of laughter) when tickled, laughter is essentially a call meaning "non threat."
Jokes are funny because they relate a story of the transition of the object of laughter from potential threat, to non-threat. For example, a high status individual is a potential economic and social adversary and therefore a potential threat.
Consider: If someone slips on a banana peel it is only funny if it is a high status or would-be high status individual. If a handicapped child slipped on a banana peel it would only engender sympathy, not laughter. If a pompous or powerful and aggressive person slips on a banana peel it is funny because that person has instantly gone from the status of potential threat - someone to be reckoned with - to the status of non-threat.
Jokes, especially those with punch lines, follow a narrative thread where some person or persons make a sudden transition from high to low status, from threat to non-threat.