ATP synthase operates through a rotary mechanism. The flow of protons through the enzyme causes it to rotate, bringing ADP and Pi into close proximity and facilitating their combination into ATP. This process is known as the chemiosmotic theory, proposed by Peter Mitchell.