According to https://en.wikipedia.org/wiki/Petard, Pétard comes from the Middle French péter, to break wind, from the root pet, expulsion of intestinal gas, derived from the Latin peditus, past participle of pedere, to break wind. In modern French, a pétardis is a firecracker (and it is the basis for the word for firecracker in several other European languages).
Shakespeare in Hamlet Act 3, Scene 4, has Hamlet use the phrase, “hoist with his own petard,” to mean, “defeated/blown up with their own plan/bomb.” A petard is a small bomb that was once used to blow up gates and walls when breaching them.