How does the moon control ocean tides on Earth?
The moon's gravity pulls on Earth's oceans, creating a bulge of water on the side of Earth facing the moon. A corresponding bulge also forms on the opposite side of Earth, caused by inertia as Earth and the moon orbit their common center of mass. As Earth rotates, different locations pass through these bulges, experiencing high tides roughly twice a day.
The sun also exerts a tidal force on Earth's oceans, though weaker than the moon's. When the sun and moon align during new and full moons, their combined pull creates stronger spring tides. When they are at right angles during quarter moons, their forces partially cancel, producing weaker neap tides.