The ATP synthase is a mitochondrial enzyme localized in the inner membrane, where it catalyzes the synthesis of ATP from ADP and phosphate, driven by a flux of protons across a gradient generated by electron transfer from the proton chemically positive to the negative side.