Reduced NAD is oxidised at the first carrier of the electron transport chain and reduced FAD oxidised at the second. The free electrons move into the system of carriers within the membrane while the protons are initially released into the mitochondrial matrix. The energy generated from the electrons moving between the carriers is used to pump protons into the intermembrane space, setting up an electrochemical gradient.
The protons move back across the mitochondrial double membrane into the matrix via the ATP synthase carrier and this movement (called chemiosmosis) drives the binding of ADP and phosphate which generates ATP. The electrons from the last electron carrier and the protons from ATP synthase bind to oxygen (the terminal electron acceptor) which makes water.