Hoist with his own petard is a Shakespearean idiom. William Shakespeare wrote "hoist with his own petard" in Hamlet. The word "hoist" is the (now-archaic) past participle of "hoise", the earlier form of the verb "hoist".
In the following passage, the "letters" refer to instructions written by Hamlet's uncle Claudius, the King of Denmark, to be carried sealed to the King of England, by Hamlet and his schoolfellows Rosencrantz and Guildenstern. The letters, as Hamlet suspects, contain a death warrant for Hamlet, who later opens and modifies them to refer to Rosencrantz and Guildenstern. Enginer refers to a military engineer; the spelling reflects Elizabethan stress.
There's letters seal'd: and my two schoolfellows,
Whom I will trust as I will adders fang'd,
They bear the mandate; they must sweep my way
And marshal me to knavery. Let it work;
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.
After modifying the letters, Hamlet escapes the ship and returns to Denmark. By "hoist with his own petar" (literal translation: "cause the bomb maker to be blown up with his own bomb"), Hamlet means he is metaphorically turning the tables on Claudius, whose messengers are to be killed instead of Hamlet. Shakespeare's use of "petar" (flatulate) rather than "petard" may be an off-colour pun.