Many have heard this statement. Here is the background. Shakespeare, specifically Hamlet, act III, scene 4, lines 206 and 207: "For 'tis sport to have the engineer/ Hoist with his own petar …"
The Melancholy Dane is chuckling over the fate he has in store for his childhood comrades, Rosencrantz and Guildenstern, who are plotting to have him killed. Deferring his existential crisis for a moment, Hamlet turns the plot on the plotters, substituting their names for his in the death warrant they carry from King Claudius.
He continues: "But I will delve one yard below their mines/ And blow them at the moon." The key word is "mines," as in "land mines," for that's what a petard is (or "petar," as Shakespeare wrote. A small explosive device designed to blow open barricaded doors and gates, the petard was a favorite weapon in Elizabethan times.
Hamlet was saying, figuratively, that he would bury his bomb beneath Rosencrantz and Guildenstern's and "hoist" them, i.e., "blow them at the moon."
The word "petard," comes from the Middle French peter, which derives in turn from the Latin peditum, to break wind. So, a small explosion.