A widely held view during Galileo's time connected movements of the Moon to the rise and fall of the tides. However, prior to Newtonian physics and recognition of the law of gravitation, which says that all objects are attracted to and by all other objects, an explanation for the Moon's effect on Earth's oceans was lacking.
Physicists now know that just as Earth's gravity pulls at the Moon, keeping it in orbit around our planet, the Moon also pulls at Earth. This pull causes ocean water to bulge on the side of Earth nearest the Moon. Surprisingly, it makes the water bulge on the other side of Earth at the same time. The simplest way to understand the two bulges is to realize that the Moon's gravitational pull is strongest on the water closest to the Moon, a bit weaker on the solid Earth and weaker still on the water on the far side of Earth. In essence, the Moon is both pulling the water that is closest to it away from Earth and pulling Earth away from the water on the far side.
Because Earth turns on its axis, making a full rotation every 24 hours, different points on Earth's surface are subject to these forces at different times. Nearest the Moon, ocean waters bulge and tides rise. As Earth's rotation continues away from the Moon's gravitational pull, tides recede, only to rise again about 12 hours later on the side of Earth, opposite the Moon. Because the Moon orbits Earth in the same direction as Earth spins on its axis (though much more slowly), each high and low tide arrives about 25 minutes later than the previous day's tides.