Early gunpowder bomb. Used for knocking down gates and doors of castles. Given medieval quality control, there was a fair chance that the poor schmuck who lit the fuse would be immediately blown up, thus he was hoist (into the air, in little pieces) by his own petard.
Actually the petard is not the gunpowder bomb. The petard is the large metal device that is used press up against the gates of a walled city or castle to knock them down. When the gunpowder blast went off it insured that the door (or wall) would fall into the city rather than fall back onto those trying to gain entry.
Sometimes the gunpower went off prematurely and the bomber was blown into the air and 'hoist on his own petard' - in other words, he would land on and be hanging from the large metal device.
By the way, the word petard is derived from the old French term - petou - which means to break wind.