Well actually we have a three body gravity problem your have a earth Moon that appears to be one body, orbiting the sun, then your have the Earth moon orbiting each other to the common center Of gravity of the two which is below the earth's surface and it is this common center of gravity that stays in line with the moon, that creates the tides. As the moon is the smaller body is the one having speed when formed after colliding with the earth, the speed has slowly increase to it's current speed and moving further out, as the earth has slowed it's spin. This is currently the most acceptable theory to the question.
fix my error i think i have it right now.