During smelting, when the ore is exposed to high temperatures, these impurities are separated from the molten metal and can be removed. The collection of compounds that is removed is the slag.
Different smelting processes produce different slags. The smelting of copper and lead, for instance, separates out a great deal of iron silicate. Slag from steel mills contains calcium, magnesium, and aluminum.
Slag has many commercial uses, and is rarely thrown away. It is often reprocessed to separate any other metals than it may contain. The remnants of this recovery can be used in cement, roadworks, and as fertilizer.