It’s all down to gravity. The moon is really heavy, so the part of the ocean that is directly under the moon will ‘bulge’ out a bit, and as the moon moves along it drags water with it. That’s why tides go in approximately 28 day cycles, which is the orbit of the moon
Comments