Tides in the ocean are primarily caused by the gravitational pull of the moon and the sun on the Earth's water bodies. The gravitational force of the moon causes the water on the side of the Earth closest to the moon to be pulled towards it, creating a high tide, while the water on the opposite side is pulled away, creating a high tide on the other side as well. This gravitational force also creates low tides in between the high tides. The sun's gravitational pull also affects tides, though to a lesser extent due to its greater distance from Earth.