Metamorphosis
Metamorphosis is a stage illusion invented by John Nevil Maskelyne, but most often associated with famous magician and escape artist Harry Houdini.
The Trick
In the illusion, the magician is locked inside a large box or trunk, usually after being restrained with handcuffs, ropes, bags, etc. The magician's assistant stands upon the trunk and holds a curtain up to momentarily conceal her entire body. The curtain is immediately lowered, revealing that the magician is now standing atop the box, the magician and assistant having changed places instantaneously. When the box is opened, it is shown to contain the assistant, restrained as the magician had been.
How
The Metamorphosis uses a device known as the substitution trunk, which has a secret panel that allows its occupant to sneak out. The magician and his assistant can then change places. Restraints will usually be rigged in such a way that they can be quickly removed.