Writing humor may be the most challenging, complicated, and difficult tasks we face. Difficult when it comes to execution, that is. Conceptually, there’s one key to everything that’s ever made anyone think something conveyed in written form is funny. One key that fits a million locks. A single element that every punch line to every joke ever told in any language as well as the broader, less “laugh out loud” humor found in Terry Pratchett’s comic fantasy and Kurt Vonnegut’s satire have in common.
A lot of it can be boiled down to a single word: Juxtaposition.
Note that a number of Different theories of humor have evolved over the past few centuries, the most prevalent being incongruity theory, relief theory, and superiority theory. The distinctions between them are philosophical in nature, not practical. Using a generic locker room sex joke as an example, incongruity theory will point to the structure of the joke, the thing that makes the punch line a surprise and therefore funny, and say humor stems from that. Freud would point to that joke as a classic example of relief theory, since, to him, we do nothing but walk around repressing sexual desires whilst sticking large cigars in our mouths. Thomas Hobbes’, the originator of superiority theory would say the humorous denigration found in the sex joke gives rise to a “kind of sudden glory” that boosts our self esteem (relative to whomever is the butt of the joke).
To simplify things a bit, one clear strain runs through all of them (as well as the less widely accepted theories). Without an unexpected outcome or high degree of contrast between the situation and the actor’s response, there is no joke.
My take is: incongruity theory wins. NOT because it was championed by the likes of Arthur Schopenhauer, Immanuel Kant, and Herbert Spencer three hundred years ago, but because everything we’ve learned since supports it. At the Institute of Neurology in London, neuropsychologists Vinod Goel and Raymond Dolan describe successful jokes as "a cognitive juxtaposition of mental sets, followed by an affective feeling of amusement." The “feeling of amusement” is the response (a hugely important part of any joke, for sure, but not one we can put on the page). That means when we’re writing, a joke is nothing more than a cognitive juxtaposition of mental sets—something out of place for a situation running into the familiar or expected. Like, for example, the punch line to every funny joke you’ve ever heard. Those words become a “joke” when the brain’s response goes from deciphering (reading the code in the joke to reconcile the incongruity) to rewarding the reader for doing so by activating an area of the brain called the medial prefrontal cortex, a reward center.
Love or hate any of those theories, Understanding this basic idea means understanding humor. Its importance cannot be overstated, which is why this post about “humor” is probably the least sarcastic most boring-ass thing I’ve written in my life. If you are trying to sprinkle humor into a serious book, the issue is mixing in the punch line in an otherwise serious situation. For a satirist like Pratchett or Vonnegut, the opposite is true, which explains the strong, slightly formal and authoritative voice their third-person, often omniscient narrators speak in. The tricky part is finding that balance, and the first step is knowing your end goal is juxtaposition, which can be achieved in a million ways.