3rd step of cellular respiration.
NADH and FADH2 drop their electrons at the ETC. Electrons moved along the chain, and each time them are moved, a proton is pumped out into the inner-membrane space. This creates an electromagnetic field between the positive and negative charge concentration gradient. Electrons that reach the end of the ETC connect with O2 to form H2O. Finally, protons rush through the ATP synthase to create 26-28 ATP. The rushing is used to attach a phosphate group to ADP to create ATP.
In: 8 NADH, 2 FADH2, 6O2
Out: 28 ATP, 8 NAD+, 2 FAD, 6H20
Where: inner membrane space