What causes tides, and why are there two a day?
Tides are caused by the difference in gravitational pull across the Earth, primarily from the Moon and secondarily from the Sun. The two-a-day pattern follows from that difference rather than from gravity itself.
Why there are two bulges. This is the part that confuses people, since only one side faces the Moon.
Gravity weakens with distance. The Moon therefore pulls:
Most strongly on the near side of Earth — the water there is pulled toward the Moon, creating a bulge.
Moderately on the Earth's centre.
Least on the far side — so the far-side water is pulled less than the planet is, and effectively gets left behind, creating a second bulge on the opposite side.
What matters is not the Moon's gravity but the gradient of it across Earth's diameter — the tidal force, which is the difference between the pull at a point and the pull at the centre.
Earth rotates through both bulges, so most coasts experience two high and two low tides roughly every 24 hours 50 minutes — the extra 50 minutes because the Moon has moved along its orbit in the meantime, which is why tide times shift daily.
The Sun contributes too, at roughly 45% of the Moon's tidal effect. Despite being vastly more massive, it is far further away, and tidal force falls with the cube of distance rather than the square.
Spring and neap tides. When Sun, Earth and Moon align — at full and new moon — the effects add, producing spring tides with the largest range. At the quarter moons they partly cancel, producing smaller neap tides. Spring has nothing to do with the season.
Why local tides vary enormously. The idealised model assumes a uniform ocean. In reality, coastline shape, water depth, basin resonance and Coriolis effects dominate. The Bay of Fundy sees over 16 metres; parts of the Mediterranean see centimetres, and some coasts have only one tide daily.