Overview
A deathtrap is a literary and dramatic plot device in which a villain who has captured the hero or another sympathetic character attempts to use an elaborate, improbable, and usually sadistic method of murdering them.
It is often used as a means to create dramatic tension in the story and to have the villain reveal important information to the hero, confident that the hero will shortly not be able to use it. It may also be a means to show the hero's resourcefulness in escaping, or the writer's ingenuity at devising a last-minute rescue or deus ex machina.
History
This plot device is generally believed to have been popularized by movie serials and 19th-century theatrical melodramas. A well-known example is the cliché of the moustache-twirling villain leaving the heroine tied to railroad tracks. Its use in the James Bond film series and superhero stories is well known.
Famous examples
The Engineer's Thumb (Sherlock Holmes story): the engineer Victor Hatherley is trapped inside a hydraulic press which would crush him to a pulp
Escape method: a woman working for the villains but not sharing their criminal ruthlessness opens a side panel at the last moment, allowing Hatherley to escape
Raiders of the Lost Ark: Sealing Indiana Jones and Marion in the Well of Souls
Escape method: Seeing a possible tunnel entrance, Jones climbed a statue and toppled it towards the wall to create an entrance to a passageway that led to the outside.
Live and Let Die: Doctor Kananga and a minion tie James Bond and Solitaire to a platform to be lowered into a shark-infested pool to be eaten alive.
Escape method: Without the villains seeing, Bond activates his watch's rotary saw function to cut through his restraints to free himself and attack Kananga.
Goldfinger: James Bond is shackled spreadeagled to a table and a circular saw (a laser in the film) is approaching to cut him in half.
From Wikipedia (CC BY-SA 4.0).