According to the Guinness Book of World Records, in 1921, the world's first faux hemicorporectomy was performed in London by illusionist Percy Selbit. In the original version, the girl was entirely enclosed in the box. So, the "ta-da effect" must have been somewhat underwhelming.
But time brings progress, and later that year the American Horace Goldin performed the trick in New York with his assistant's head and feet protruding from the box (the assistant, incidentally, was male). The rest is history.
As Wikipedia explains, the trick is fairly basic. The assistant just curls up in the top half of the box. Since the audience only sees the box from the side, it appears much less spacious.
But how do we explain the feet, which often wriggle and squirm? Well, if they're not fake and being powered electrically, they usually belong to a second assistant hiding inside the table upon which the box is resting.
The Mallusionist goes on to explain the mechanics behind several other variations of the trick. Incidentally, this is a great resource for finding how other kinds of illusions work. Rabbit from a hat, anyone?
There remains a debate about the origin of sawing illusions, with some sources saying a magician named Torrini may have performed the first version in front of Pope Pius VII in 1809.[1] However it is more likely that the story is a fiction which has its roots in the writings of the famous French magician Jean Robert-Houdin. In his Memoirs, written in 1858, Robert-Houdin described a sawing illusion performed by a magician named Torrini. Modern magic inventor and historian Jim Steinmeyer has concluded that there was probably no real Torrini and the story was merely a way for Robert-Houdin to play with ideas.[2] It was suggested during a court case in 1922 that the trick can be traced back to ancient Egypt. However this claim has not been substantiated.[3][1] Wherever the idea originated, until the 1920s it remained just that, an idea for an effect rather than a practical application of a method.