A petard is a small bomb used to blow up gates or walls of an enemy’s fortifications. William Shakespeare coined the phrase “Hoist with his own petard,” in his play Hamlet:
For ’tis the sport to have the enginer
Hoist with his own petar; and ‘t shall go hard
But I will delve one yard below their mines
And blow them at the moon: O, ’tis most sweet,
When in one line two crafts directly meet.
It literally means that the bomb maker (enginer) is blown up (hoist) by his own bomb (petard) and has since become an idiomatic phrase meaning that someone has fallen into their own trap.
Petard comes from the Middle French word “peter” which means “to flatulate.” So “hoist with his own petard” is also an inter-lingual pun meaning “lifted/blown up by his own fart.” Shakespeare’s spelling of petard without the final ‘d’ probably indicates that this bawdy pun was intentional.
In Modern French, “petard” is still used to mean fire-cracker.
So next time someone passes gas to their own chagrin or near-asphyxiation, you may properly employ the phrase “Hoist with his own petard” as a witty and appropriate comment. But use with caution, lest you be hoist with your own petard!