How does the Moon affect Earth's ocean tides?
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, because that water is being pulled less strongly toward the Moon than Earth's solid body is, effectively leaving it behind. As Earth rotates through these two bulges, most coastal locations experience two high tides and two low tides each 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 forces combine to produce stronger spring tides. When they are at right angles during quarter moons, their forces partially cancel, producing weaker neap tides.