Cannoneers pulled the cannon around with ropes called petards.
Knights ordered captured cannoneers to be hanged with their own cannon rope, thus "Hoist by his own petard."
IIRC, petards were small explosive devices used originally for breaching gates/walls. Thus, being "hoist with one's own petard" means being "blown up by one's own bomb," as it were. In Hamlet, the title character puns on the phrase using petar, referring to flatulence. A blast by any other name, so to speak...
A mind without instruction can no more bear fruit than can a field, however fertile, without cultivation. --- Cicero