Rotation and revolution of the moon cause the generation of a tidal force. The combination of gravitational force in between the moon, the earth, and the sun and the revolution and rotation of the earth-moon and Earth-sun system.
This leads to rising ocean level which is called high tide. The moon has a huge effect on ocean level bulge of the tides than the Sun.
As Earth rotates, the Moon's gravity causes the oceans to seem to rise and fall. (The Sun also does this, but not as much.) There is a little bit of friction between the tides and the turning Earth, causing the rotation to slow down just a little. As Earth slows, it lets the Moon creep away.