Familiarity with a joke, or the references behind a joke, is essential to delivering a fun, humorous experience for an audience (readers).
Think of "familiarity with a joke" as context. One of my favorite jokes, because it's SO corny, is "Two drums and a cymbal fall off of a cliff. Ba-dump tsh." I think that's funny. Not gut-busting funny, but still chuckle-worthy. Almost everyone I've told that joke to cracked a smile or laughed out loud. Except for one. She didn't grow up in the U.S. where the rimshot gained its greatest fame in the early nineties. She didn't even grow up in a Western nation. And despite the reach of Western pop-culture, that particular bit hadn't made it to Thailand. Where she grew up. So I told her that joke and got a blank stare. Because it was completely outside of her lifetime experience. Which means the context of the joke simply isn't funny.
See? Context is a HUGE deal. A familiarity with the references a joke is making are essential to understanding the punchline. That can make the difference between a successful joke and a total flop. Keep that in mind in your writing, if you're putting comedy in your book, because a reference to an inside joke shared by two characters but never shared with the reader will be nothing more than a wasted sentence. But if you set up the joke through pages of character-building and deliver a punchline after chapters and chapters of buildup, the reader will laugh and laugh and laugh. Because they get it. They're FAMILIAR with the CONTEXT.
Now for a writing exercise: go write a joke. Just a quick joke. Less than two hundred words. Is it funny? Are people laughing (other than you)? Now CUT IT DOWN. Less than one hundred words. If it works in the space of two breaths, chances are, you have a winner.
Post it in the comments, if you like.