I sort of knew that science was behind even humor. Every reaction has a reason – a reason why the audience laughs, the timing of the laugh, how long they laugh, how the laughing wave goes up and down, etc. Although I knew, I’ve been playing and adjusting it by ear. Then I learned the existence of Humor Research Lab (HuRL)! Whaaaaat? I know! That’s what I said when I heard it for the first time. The Benign Violation Theory is one of their research theories.
HumorCode-VennDiagrams-BVT
According to the theory, humor occurs when and only when three conditions are satisfied: (1) a situation is a violation, (2) the situation is benign, and (3) both perceptions occur simultaneously.

For example, play fighting and tickling, which produce laughter in humans (and other primates), are benign violations because they are physically threatening but harmless attacks.

A violation refers to anything that threatens one’s beliefs about how the world should be. That is, something seems threatening, unsettling, or wrong. From an evolutionary perspective, humorous violations likely originated as threats to physical well-being (e.g., the attacks that make up tickling, play fighting), but expanded to include threats to psychological well-being (e.g., insults, sarcasm), including behaviors that break social norms (e.g., strange behaviors, flatulence), cultural norms (e.g., unusual accents, most scenes from the movie Borat), linguistic norms (e.g., puns, malapropisms), logic norms (e.g., absurdities, non-sequiturs), and moral norms (e.g., disrespectful behavior, bestiality).

Whether you agree with the theory or not, check the lab and their reports. You may discover new findings!