A comedy is entertainment consisting of jokes intended to make an audience laugh. For ancient Greeks and Romans a comedy was a stage-play with a happy ending. In the Middle Ages, the term expanded to include narrative poems with happy endings and a lighter tone. In this sense Dante used the term in the title of his poem, La Divina Commedia.
The phenomena connected with laughter and that which provokes it has been carefully investigated by psychologists and agreed upon the predominating are incongruity or contrast in the object, and shock or emotional seizure on the part of the subject. It has also been held that the feeling of superiority is an essential factor: thus Thomas Hobbes speaks of laughter as a "sudden glory." Modern investigators have paid much attention to the origin both of laughter and of smiling, as well as the development of the "play instinct" and its emotional expression.
Much comedy contains variations on the elements of surprise, incongruity, conflict, repetitiveness, and the effect of opposite expectations, but there are many recognized genres of comedy. Satire and political satire use ironic comedy used to portray persons or social institutions as ridiculous or corrupt, thus alienating their audience from the object of humor.
Parody borrows the form of some popular genre, artwork, or text but uses certain ironic changes to critique that form from within (though not necessarily in a condemning way). Screwball comedy derives its humor largely from bizarre, surprising (and improbable) situations or characters. Black comedy is defined by dark humor that makes light of so-called dark or evil elements in human nature. Similarly scatological humor, sexual humor, and race humor create comedy by violating social conventions or taboos in comedic ways.