Nowadays the name “Jack in the box” is usually applied to a toy, a box from which a frightening figure, such as a dragon, serpent, clown, or the like, springs out when the fastening of the lid is released.
The toy, however, is a very modest proxy for the original box of the sixteenth century, which was also designed to delude or deceive the person who opened it.
That is, it was a box, empty or containing worthless trash (the jack), which a clever cheat or sharper substituted for the box or small chest of money that a tradesman expected to receive for his merchandise.
Hence, the sharper himself became a jack-in-the-box.
One of the Satirical Poems of the Time of the Reformation, in 1570, has the lines, in modern spelling:
Jack in the box,
For all thy mocks
A vengeance might (on) thee fall!
And palliardy (knavery)
Our freedom brings in thrall.