Why are some things funny? Philosophers have asked that for millenia but two marketing people think they've come up with the formula: humor comes from a violation or threat to the way the world ought to be that is, at the same time, benign. 

Most theories of humor are missing something, says A. Peter McGraw, assistant professor of marketing and psychology at the University of Colorado-Boulder, who co-authored the study with Caleb Warren, a Ph.D. candidate in marketing. Freud thought humor came from a release of tension, another theory holds that humor comes from a sense of superiority, and still another from incongruity.

The two note that all of these could happen if you accidentally killed your spouse—but that wouldn't be funny. They believed that a situation might be funny only if it also seems benign.

To test their hypothesis, they presented various situations to volunteers they rewarded with candy bars. In one experiment, the volunteers read pairs of situations—for example, one where Jimmy Dean hired a rabbi as spokesman for their new line of pork products, and one where Jimmy Dean hired a farmer as spokesman for their new line of pork products. The situation with a moral violation—having a rabbi promote pork—was both more likely to be seen as wrong and more likely to make the reader laugh.

The other part of the study tested whether benign appraisals of a moral violation made it funnier. For one experiment, participants read a scenario in which either a church or a credit union raffles off an SUV to attract new members. The participants were disgusted when the church attracted members with a raffle, but not the credit union. But whether they were amused by the church depended in part on whether they went to church themselves; non-churchgoers were more likely to think that was funny.

They believe this is because the non-churchgoers are "not particularly committed to the sanctity of churches," says McGraw—so for them, the moral violation seems benign. Another experiment confirmed that people who have more psychological distance from a moral violation are more likely to be amused. 

"We laugh when Moe hits Larry because we know that Larry's not really being hurt," says McGraw, referring to The Three Stooges films. "It's a violation of social norms. You don't hit people, especially a friend. But it's okay because it's not real." He points out a recent example, an Internet video of a chain-smoking Indonesian toddler. "When I was first told about that, I laughed, because it seems unreal—what parent would let their kids smoke cigarettes? The fact that the situation seemed unbelievable made it benign. Then when I saw the video of this kid smoking, it was no longer possible to laugh about it." 

McGraw thinks the theory works for other kinds of humor, like puns, which break a linguistic convention or rule but are still okay because they adhere to another rule, so the sentence still makes sense. It also explains why dramas and action movies play better outside of their home countries than comedies do. "It's hard to find a comedy that's funny cross-culturally because the ways that violations can be benign differ from culture to culture. The comedy that is funny cross-culturally tends to involve a lot of physical humor. The violations are clear no matter who you are," he says.

The research will be published in Psychological Science.