Gary Larson, in The Prehistory of the Far Side:

[T]he key element in any attempt at humor is conflict. Our brain is suddenly jolted into trying to accept something that is unacceptable. The punch line of a joke is the part that conflicts with the first part, thereby surprising us and throwing our synapses into some kind of fire drill… And the emotional response to this kind of conflict can range from laughter to a broken nose. In any humorous vehicle (comedy, cartoons, Pintos, etc.), this conflict, whether subtle or blunt, is mandatory.