The iron maiden is a made-up piece of torture equipment consisting of a human-shaped cabinet with sharp spikes lining the interior. When closed, the spikes would hypothetically press lightly against the prisoner, requiring them to stand perfectly straight and still to avoid piercing themselves with the spikes.
It appears that the iron maiden was first conceived of in 1793 by Johann Philipp Siebenkees, a German professor of (among other things) archeology. According to Siebenkees' pamphlet on the subject, it was first used on August 14, 1515, and was used as a particularly gruesome means of execution; he claimed it was used to fatally wound a coin forger, mauling him in such a way that it took him two days from him to die from the injuries.
It is unclear why he invented it. It may have been a misinterpretation of the Schandmantel, a medieval German shaming device akin to a heavy barrel (without the spikes) -- although his rather thorough, and gruesome, back-story indicates that it may have been an intentional hoax. In either case, it caught the public's imagination, and replicas of iron maidens were popular attractions in museums and travelling shows for centuries, and have made numerous appearances in fictional works.