Not getting the joke is a threat in social terms, because if you don't get the connection between something and something else, perhaps you are stupid. That is a threat, if the others find out. There is another threat. Maybe that's how a punchline gets that name. Cross the timeline without laughing, and the punch will materialise.
Laughter is a tool for enforced social conformance, for coercion.
Laugh at my jokes, or else. I share your tribal assumptions, prejudices. I fit in. I recognise your protective power. The threat is over, for you, for the group, for all concerned.