Smelting involves thermal reactions in which at least one product is a molten phase.
Metal oxides can then be smelted by heating with coke or charcoal (forms of carbon), a reducing agent that liberates the oxygen as carbon dioxide leaving a refined mineral.  Concern about the production of carbon dioxide is only a recent worry, following the identification of the enhanced greenhouse effect.
Carbonate ores are also smelted with charcoal, but sometimes need to be calcined first.
Other materials may need to be added as flux, aiding the melting of the oxide ores and assisting in the formation of a slag, as the flux reacts with impurities, such as silicon compounds.
Smelting usually takes place at a temperature above the melting point of the metal, but processes vary considerably according to the ore involved and other matters.