I think a lot comes from having the experience of doing stand-up comedy. It allows you to figure out the psychology of an audience what things are funny and not.
I never yet feared those men who set a place apart in the middle of their cities where they gather to cheat one another and swear oaths which they break.