The passage on the nature of comedy in the Poetic of Aristotle is unfortunately lost, but if we can trust stray hints on the subject, his definition of comedy (which applied mainly to Menander) ran parallel to that of tragedy, and described the art as a purification of certain affections of our nature, not by terror and pity, but by laughter and ridicule. [Rev. J.P. Mahaffy, "A History of Classical Greek Literature," London, 1895]The classical sense of the word, then, was "amusing play or performance," which is similar to the modern one, but in the Middle Ages the word came to mean poems and stories generally (albeit ones with happy endings), and the earliest English sense is "narrative poem" (such as Dante's "Commedia"). Generalized sense of "quality of being amusing" dates from 1877.
Comedy aims at entertaining by the fidelity with which it presents life as we know it, farce at raising laughter by the outrageous absurdity of the situation or characters exhibited, & burlesque at tickling the fancy of the audience by caricaturing plays or actors with whose style it is familiar. [Fowler]