During the electron transport chain, reduced molecules such as NADH, FADH transfer their electrons to recipient molecules and become oxidised. The energy released during this electron transfer is used to pump out H⁺ ions from matrix of mitochondria to the inter membrane space against the H⁺ ion concentration gradient.
This builds a H⁺ concentration gradient across the inter membrane space to the matrix also called the proton motive force. Therefore H⁺ ions want to move from higher concentration in the inter membrane space to the lower concentration in the matrix. H⁺ ions can move across the phospholipid bilayer only through ATP synthase channels located in the membrane. ATP synthase acts as a turbine that turns with H⁺ ions moving to the matrix, as it turns the energy gained from this proton gradient is used to add a phosphate to ADP producing ATP molecules. This process is known as chemiosmosis by which ATP molecules are produced by the energy released from the proton gradient created.