Every integrated circuit, passive component, wire, and connector is cleaned with an acid called flux and attached to printed circuit boards with a carefully engineered combination of metals called solder.
As the temperature of a pure substance, such as water, increases, it will undergo phase transitions at specific temperatures and pressures. In alloys, the discrete transition temperatures that exist between the solid-phase α and liquid-phase L morph into transition temperature ranges as a new intermediate phase of matter appears that is part liquid and part solid α+L. If you’ve ever seen dirty snow in the wintertime, you’ve likely seen that the intermediate phase appears as slush in a puddle.
Having an assortment of solder to choose from allows a variety of benefits, the first of which is that it allows multiple reflow cycles during the PCB assembly process. To form a proper bond, the metallic pad of an IC must form bonds with the solder, and the solder must then form bonds with the copper on the PCB pad. This cannot happen if there is any oxidation on the surface of either the part or the pad of the PCB. Flux is used to cleanse pads immediately before the solder covers the joint.
Flux is used wherever solder is used to both clean the base materials and to decrease the surface tension of the solder. It is a collection of molecules that can strip oxygen atoms from the surface of a base material and provide an atmospherically impervious surface layer that prevents new oxygen molecules from bonding. In electronics, flux is mixed with the solder.
Base materials, such as copper, start to react with oxygen in the atmosphere the moment they from etching/electroplating tanks at the fabrication house. The oxygen binds to the surface copper molecules on the outer-sides of the PCB and prevents the solder molecules from bonding with the copper. Even if the oxide layer is sanded from the surface of the copper, it will reform almost immediately upon exposure to room air. A layer as thin as one or two molecules is sufficient to keep solder from properly bonding to copper.
The flux is designed to melt at a lower temperature than the solder so that it has time to react with the base metals. It spreads along the surface of a material and then floats atop the solder metal when the solder begins to spread.
For more details on the phase changes of mixtures and alloys, different types of fluxes, melting temperatures, and wetting characteristics download this free whitepaper.