English drama critic Thomas Rymer coined the phrase in The Tragedies of the Last Age Considered (1678) to describe how a work should inspire proper moral behavior in its audience by illustrating the triumph of good over evil. The demand for poetic justice is consistent in Classical authorities and shows up in Horace, Plutarch, and Quintillian, so Rymer's phrasing is a reflection of a commonplace. Philip Sidney, in Defense of Poetry, argued, like Aristotle, that poetic justice was, in fact, the reason that fiction should be allowed in a civilized nation.
Notably, poetic justice does not merely require that vice be punished and virtue rewarded, but also that logic triumph. If, for example, a character is dominated by greed for most of a Romance or drama, he cannot become generous. The action of a play, poem, or fiction must obey the rules of Aristotelian logic as well as morality, and when the humour theory was dominant poetic justice was part of the justification for humor plays. During the late 17th century, critics pursuing a neo-classical standard would criticize William Shakespeare in favor of Ben Jonson precisely on the grounds that Shakespeare's characters change during the course of the play. (See Shakespeare's reputation for more on the Shakespeare/Jonson dichotomy.) When Restoration comedy, in particular, flouted poetic justice by rewarding libertines and punishing dull-witted moralists, there was a backlash in favor of drama, in particular, of more strict moral correspondence.
"For 'tis the sport to have the enginer / Hoist with his own petard." (Shakespeare, Hamlet (III.iv.207).)
The "Inferno" portion of Dante's Divine Comedy reads like a compendium of examples of poetic justice.
Almost every episode of The Twilight Zone features poetic justice, usually due to an ironic twist.
An interesting and unusual example of poetic justice is found in Dr Pradhan's Sahitya Akademi award-winning poem Equation where the economic-sexual exploiters of poor tribals in Kalahandi, (Orissa) get paid back in their own coin when they get afflicted with various maladies and sexually transmitted diseases.
Poetic justice is referred to in The Simpsons episode "Boy Scoutz N the Hood." When Bart returns home from a Junior Campers meeting Homer asks "How was jerk practice, boy? Did they teach you how to sing to trees and build crappy furniture out of useless wooden logs?" The chair that Homer is sitting on then breaks and he declares "D'oh! Stupid poetic justice."
In the film Batman Returns, The Penguin informs his traitorous cohort Max Shreck, that he will be killed in a pool of the toxic byproducts from his "clean" textile plant. The Penguin goes on to wonder if this is tragic irony or poetic justice.
Disney films, most specifically animated films, often use poetic justice as an ending device (examples include The Lion King, Aladdin, and The Great Mouse Detective, among many others), with the hero being rewarded, and the villain being punished in ironic and, occasionally, fatal ways.
In the Tim Burton's film, Sweeney Todd: The Demon Barber of Fleet Street, as well as in the short story and the musical, the titular character, Sweeney Todd, kills his customers with a razor blade. In a twist of the story, at the end, having assassinated the Judge and the Beadle, Todd is killed by Toby, a boy he kept with Mrs. Lovett, with his own razor blade.