The Moon's gravity pulls the Earth's water surface into two bulges, one on the side facing the Moon and the other on the opposite side. The water on the side of the Earth closest to the Moon is pulled, by the Moon's gravitational force, much stronger than the mass of the Earth. The water on the side furthest from the Moon has a weaker pull than the gravitational force of the Earth. As the earth rotates under this ocean bulge, it causes a high tide. The height of the tide is determined by the shape of the coastline and of the nearby continental shelf.
A change in the gravitational force across the body of the earth produces two bulges, causing us to experience two high tides, and two low tides each day. The tides make the earth slow down its rotation around its axis, and when the angular force of the earth decreases the moon compensates by increasing its angular momentum.