Thomas Hobbes explains the nature of comedy

Sudden glory is the passion which maketh those grimaces called LAUGHTER; and is caused either by some sudden act of their own that pleaseth them; or by the apprehension of some deformed thing in another, by comparison whereof they suddenly applaud themselves.

(Leviathan, chap. vi)