In the 16th century, it was more common to say mettre le feu aux étoupes. The étoupe was the coarsest part of the oakum, which is untwisted rope or hemp that is tarred or oiled. It was used—among other things—to make the wicks for weapons, but also as caulking for the cracks between the boards to seal the hull of a wooden ship.
When a ship’s captain could tell in advance that a battle would be lost, he could give the order to set the oakum on fire, mettre le feu aux étoupes. At that point, the gunner brought and lit a long wick from the powder barrels stored on board and the sailors jumped into the water before the ship exploded.
The étoupes were replaced by poudres in the 18th century, making a distinction between lighting a fuse and setting off gunpowder.
In an older figurative sense, the expression meant “to provoke loving passions.” Today, it is used more often in the sense of “triggering conflict or disaster.”