The purpose of smelting an ore is
to reduce it
to obtain an alloy
to separate volatile impurities
to oxidize it
Metal oxides are reduced to metal by smelting.