In contemporary usage, parody is a form of satire that imitates another work of art in order to ridicule it. Parodies exists in all art media, including literature, music and cinema.
In ancient Greek literature, a parody was a type of poem that imitated another poem's style. Indeed, the Greek roots of the word "parody" can be recognized elsewhere: "para-" in, for example, "parapsychology" and "-ody" in "ode". The original Greek meant, roughly, "mock poem".
Roman writers explained parody as an imitation of one poet by another for humorous effect. In FrenchNeo-classical literature, "parody" was also a type of poem where one work's style is imitated by another for humorous effects.
The first usage in English of the word "parody" is in Ben Jonson, in "Every Man in His Humour." Jonson uses the term without any explanation -- suggesting that the word was already understood by some part of the audience. Eighty years later, John Dryden is the next author to use "parody" in literature (i.e. not in a dictionary). In the "Preface to the Satires," Dryden explains that parody is an imitation of one poet's style for the purposes of making light of a fault in it. Dryden's definition is therefore a departure from previous usage (as he implies satire), and Dryden adapts what was still a foreign term (parody) to apply to a recent literary subgenre that had no name: the mock-heroic.
It is vital to realize that "parody," prior to the 18th century, was an effect or ornament roughly the equivalent of a musical "quotation." (Think, for example, of Mozart imitating bird songs, on the one hand, or of Felix Mendelssohn imitating Mozart, on the other.) In "MacFlecknoe," Dryden created an entire poem designed to ridicule by parody. Dryden imitates Virgil's Aeneid, but the poem is about Thomas Shadwell, a minor dramatist. The implicit contrast between the heroic style from Virgil and the poor quality of the hero, Shadwell, makes Shadwell seem even worse. When dressed in Aeneas's clothes, Shadwell looks all the more ridiculous. Other parodies of the Restoration and early 18th century were similar to Dryden's: they employed an imitaiton of something serious and revered to ridicule a low or foolish person or habit. This is generally referred to as the mock-heroic, a genre generally credited to Samuel Butler and his poem Hudibras. When conscious, the contrast of very serious or exalted style with very frivolous or worthless subject is parody. When the combination is unconscious, it is bathos (derived from Alexander Pope's parody of Longinus, "Peri Bathos)."
Jonathan Swift is the first English author to apply the word "parody" to narrative prose, and it is perhaps because of a misunderstanding of Swift's own definition of "parody" that the term has since come to refer to any stylistic imitation that is intended to belittle. In "The Apology for the &c.," which is one of the prefaces to his A Tale of a Tub, Swift says that a parody is the imitation of an author one wishes to expose. In essence, this makes parody very little different from mockery and burlesque, and, given Swift's attention to language, it is likely that he knew this. In fact, Swift's definition of parody might well be a parody of Dryden's presumed habit of explaining the obvious or using loan words.
After Jonathan Swift, the term "parody" was used almost exclusively to refer to mockery, particularly in narrative.
In the older sense of the word, parody can occur when whole elements of one work are lifted out of their context and reused. Pastiche is a form of parody, and parody can also occur when characters or settings belonging to one work are used in a humorous way in another. In Flann O'Brien's novel At Swim-Two-Birds, for example, mad King Sweeney, Finn MacCool, a pookah, and an assortment of cowboys all assemble in an inn in Dublin: the mixture of mythic characters, characters from genre fiction, and a quotidian setting combine for a humor that is not directed at any of the characters or their authors. This combination of established and identifiable characters in a new setting is not the same as the post-modernist habit of using historical characters in fiction out of context to provide a metaphoric element.
Some genre film theorists see parody as a natural development in the life cycle of any genre, especially in film.
Westerns, for example, after the classic stage defined the conventions of the genre, underwent a parody stage, in which those same conventions were lampooned.
Because audiences had seen these classic Westerns, they had expectations for any new Westerns, and when these expectations were inverted, the audience laughed.