The generally accepted theory is that the Moon's gravitational field causes the Earth to become tidally deformed. This ellipsoidal deformation in the mass of the Earth then applies a gravitational force upon the Moon which accelerates the Moon in its orbit and the Earth-Moon distance gradually increases. The Moon's action on the bulge of the Earth causes a torque that slows the Earth's rate of rotation. The net affect is that, to conserve angular momentum, the Moon's orbit increases at the expense of the Earth's spin slowing down. Ultimately, some energy is also lost from the system as the ocean tides on the Earth slosh against the continental shelves and tidal basins, dissipating energy by piling up sand and other things.