A MacGuffin (or McGuffin) is an object, device, or event necessary to the plot and the motivation of the characters, but typically unimportant or irrelevant in itself. Usually, the MacGuffin is revealed early on, and becomes less important once the storyline is set in motion.
Primarily a film term, it was popularized by Alfred Hitchcock, who called it "the mechanical element that usually crops up in any story. " Examples in his films include the meaning of "The 39 Steps" (also key in the stage version), the uranium granules in Notorious, and the stolen money that motivates all of Marion Crane's actions in Psycho. These are known as "pure MacGuffins" because they follow Hitchcock's strict criteria: they must be incredibly important to the characters, but otherwise quite vague and sometimes meaningless. Some non-Hitchcock films use the same device: The Maltese Falcon has the falcon itself, and Citizen Kane has "Rosebud," uttered by a dying Charles Foster Kane.
While not always named as such, a MacGuffin-like element can be found in plays and musicals. In Into the Woods, for example, there are the four items the Baker and his Wife must collect to break the family curse. The items themselves are of minimal value. The only thing that gives them importance is that they're all required for the Witch's potion. And yet, from a structural perspective, the four items connect all major characters and drive the main plot.