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