A differential force
The Moon pulls the ocean facing it more strongly than the Earth’s centre, and the opposite ocean less. This difference stretches the water into two bulges. The Earth turns beneath them: on Morocco’s Atlantic coast the tide is semi-diurnal, with two high waters a day about 12 h 25 min apart.
Spring and neap tides
The Sun adds its own tide, a little under half the Moon’s. At full and new moon they add up: spring tides, with a large range. At the quarters they partly cancel: neap tides. The ocean responds one to two days late.
Predicting the tide
The water level measured in a harbour is broken down into a sum of waves with known periods (lunar M2, solar S2, K1, O1…). Once their amplitudes and phases are known, the tide can be computed years ahead.