Chemiosmosis is the method which cells use to create ATP for energy. It works a bit like a water wheel creating power. ATP synthase is like a water wheel in the inner membrane of mitochondria which creates ATP by forcing ADP and phosphate together. It can only do this when there is a flow of hydrogen ions turning its wheel like structure. The hydrogen ions flow down a concentration gradient from the intermembrane space to the matrix. The gradient is created using energy from NADH and FADH which are made earlier in respiration. They hydrogen which they carry splits into hydrogen ions and electrons. The electrons move through the electron transport chain to oxygen, where they generate energy which pumps the hydrogen ions against their concentration gradient from matrix to intermemberane space, so they can flow back down again. It is like using water pumps to pump water uphill, so it can flow down and turn the water wheel.