process of extracting metals from their ores