I agree with this wiki article that it originated with miners using black powder explosives. It was easy, then, to transfer the phrase to explosives (and especially to cannon) used in warfare.