In Christopher Booker's The Seven Basic Plots, he claims that the comic plot as a genre deals with 'a coming to light of things not previously recognized.' (150 as quoted in Weitz, 75). Comedy uses devices such characters who disguise themselves, characters who swap identities, cases of mistaken identity, and misunderstood conversations among others to create a situation where something is hidden and then revealed. In theater, the audience often knows the hidden information and enjoys watching the characters discover it.
This hiding and discovery fits well with theories of humor centered on incongruity. Someone uses one mental frame to understand events, and then discovers that the original interpretation was wrong. The reader or audience enjoys the resolution of the conflicting versions of reality. Either the audience experiences the surprise resolution themselves, or they enjoy watching some of the characters experiencing the surprise.
This device of hiding and revealing also can conform to the disparagement theory of humor, where humor is a non-destructive way of adjusting social status. The comic discovery is often embarrassing to one or more of the characters. A character might create a modest falsehood to conceal a fact that might cause the social group to lower their opinion of that character. The plot then causes the false version of reality to expand. Then customarily when the expanded deception is revealed, that character's embarrassment and social downgrade are magnified.
Comedy often features a blocking character, who wants to prevent the comic heroes of the story from assuming their rightful and appropriate social places within the group. The blocking character often also wants to preserve his or her own inappropriately high social status. As Weitz says, "Comic custom ... prescribes maximum and prolonged humiliation for this character" (118).
There are many comic devices, but these are representative of a certain class of such devices that one can call "discovery devices."