When moisture is present corrosion occurs and the by product is very abrasive particles of iron sulfide and iron oxide. These two components are kin in that the sulfide will form and reside in the pipe in the absence of oxygen, but will convert to iron oxides in the presence of oxygen. The oxygen does not have to be free oxygen, but can come from the breakdown of other compounds containing oxygen atoms.
The majority of the Black Powder composition is ferrous or magnetic in nature. Other sources of Black Powder are from the mill scale from the pipe manufacturing process through high temperature oxidation of steel and flash rust created when the pipe is hydro tested.