A recent Atlantic piece on humor and psychology, which focused on the "dark psychology" of comedians, seems to me to have buried the lead:
What's really interesting to me are the relationships between humor, intelligence, and gender.
1. Humor is correlated with intelligence:
"For a 2011 study published in the journal Intelligence, Greengross gave 400 undergrads a series of verbal and abstract-reasoning intelligence tests, and then measured them against history’s greatest yardstick of hilarity: writing captions for New Yorker cartoons.
The captions were then rated by the judges, who were blind to any of the participants’ identifiable information.
As he expected, the students who scored higher on the intelligence measures also created the funniest captions. This makes sense. According to all of the theories of humor, wit involves putting discordant ideas together quickly, all while being perceptive enough to offend your audience a little, but not too much."
2. Male students wrote funnier captions than female students:
"Greengross found that the male students wrote more and funnier captions than the female students did, even though the men had only slightly larger vocabularies on average.
Of course, it could be that writing New Yorker captions isn’t how women best express humor. Or it could be that women don’t feel as comfortable spouting a bunch of violations, however benign, in a clinical setting.
The evolutionary explanation, though, is that women use humor as a proxy to select the cleverest mates from a crowd. It’s apparently how we determine mental fitness without forcing men to tattoo their SAT scores on their foreheads.
One key part of the experiment, though, was that the men were actually attempting more jokes. They wrote more captions overall, so they had more total successes.
“Men are trying harder than women to make others laugh. They tend to produce or try to produce more humor in the presence of women,” Greengross said. “On the other hand, women tend to laugh more than men in general, and especially when men are present.”
The interesting thing is that males aren't "funnier" than females; rather, they are more aggressively transgressional and try harder to make jokes because being funny plays a major role in mate selection.
3. More sexual women are funnier.
"But humor can function as a mate-luring strategy for women, too: The authors found that the female participants who had started having sex earlier or had a greater number of sexual partners were also the ones who produced the funnier captions."
Kathy Griffin jokes aside, it seems like being an aggressive, energetic woman helps in luring mates. Of course, it may simply be that funny women are more like to want to have sex with men; as one study famously showed, 70% of college men readily agreed to have sex with a complete stranger they just met, as long as she was hot.