From How Gold Works:
Removing a gold-bearing rock from the ground is just the first step in extracting gold. To isolate pure gold, mining companies use a complex extraction process. The first step in this process is breaking down large chunks of rock into smaller pieces. At a mill, large machines known as crushers reduce the ore to pieces no larger than road gravel. The gravel-like material then enters rotating drums filled with steel balls. In these drums, the ore is ground to a fine slurry or powder.
Next, mill operators thicken the slurry with water to form pulp and run the pulp through a series of leaching tanks. Leaching dissolves the gold out of the ore using a chemical solvent. The most common solvent is cyanide, which must be combined with oxygen in a process known as carbon-in-pulp. As the cyanide and oxygen react chemically, gold in the pulp dissolves. When workers introduce small carbon grains to the tank, the gold adheres to the carbon. Filtering the pulp through screens separates the gold-bearing carbon.
The carbon moves to a stripping vessel where a hot caustic solution separates the gold from the carbon. Another set of screens filters out the carbon grains, which can be recycled for future processing. Finally, the gold-bearing solution is ready for electrowinning, which recovers the gold from the leaching chemicals. In electrowinning, operators pour the gold-bearing solution into a special container known as a cell. Positive and negative terminals in the cell deliver a strong electric current to the solution. This causes gold to collect on the negative terminals.
Smelting, which results in nearly pure gold, involves melting the negative terminals in a furnace at about 2,100 degrees F (1,149 degrees C). When workers add a chemical mixture known as flux to the molten material, the gold separates from the metal used to make the terminals. Workers pour off the flux and then the gold. Molds are used to transform the liquid gold into solid bars called doré bars. These low-purity bars are then sent to refineries all over the world for further processing.