We review the main physical processes that lead to the formation of stellar binary black holes (BBHs) and to their merger. BBHs can form from the isolated evolution of massive binary stars. The physics of core-collapse supernovae and the process of common envelope are two of the main sources of uncertainty about this formation channel. Alternatively, two black holes can form a binary by dynamical encounters in a dense star cluster. The dynamical formation channel leaves several imprints on the mass, spin and orbital properties of BBHs.