In traditional joke structure, the comedian starts with a set-up or premise; "A man walks into a bar carrying a duck...", then builds on the premise with a few more details; "The bartender asks 'Where did you find that ugly old thing?' The man says 'At the pet store.' The joke ends with a witty twist: "The bartender says, 'I was talking to the duck!'" The final line of a traditional joke is known as the punchline, and should be the line that generates most of the laughter from the audience.
A punchline can be an ironic twist, a witty observation or a jarring non sequitur. Few punchlines are inherently funny out of context, but when a comedian sets up the premise and builds up the audience's expectations, the punchline is often hilariously funny. Professional stand-up comedians may appear to be telling shaggy dog stories with no point on stage, but in reality they are either setting the audience up for a tremendous punchline or stringing together smaller jokes with the classic "set-up, punchline" format.
Not all jokes have a punchline in a classic sense. Some comedic sketches simply end abruptly, or fade to black without a conclusion. Slapstick humor often relies more on an action and comical reaction instead of an actual punchline, but a pie in the face or pratfall can still work as a comical conclusion to a premise.
The origin of the term punchline is actually a mystery to etymologists. Some sources suggest the first published use of "punchline" or "punch line" to describe the pay-off line of a joke didn't appear until the 1920s or 1930s. Comedians had been using the classic "set-up, premise, punchline" format for many years before that time, however.
One theory is that the word punchline refers to the practice of emphasizing or "punching up" certain lines during a speech or monologue. Actors and broadcast journalists are trained to read their scripts with an ear towards high points and low points of audience interest. It is possible that the final line of a joke is called a punchline because the performer is expected to place stronger emphasis on it, or "punch it up" vocally.
Some believe the term is derived from one half of the medieval puppet team Punch and Judy. The modern punchline of a joke would be delivered in the same way that Punch delivered his slapstick blows on Judy. There is little convincing evidence to make such a connection, however, and the Punch and Judy plays did not rely on the same style of wordplay as traditional modern jokes.
One plausible theory centers around the very act of telling a joke or sharing a tale. Quite often, a storyteller would punctuate his story by delivering a few light taps or punches on the listener's arm or shoulder. This gesture usually came during or after the final line, thus making it the punch line.