The tides are caused by the gravitational force exerted by the Moon and the Sun on the Earth's oceans. The Moon's influence is the greater factor. The Moon's gravity pulls the water on the Earth into an elongated shape as shown (much exaggerated) in blue. The water bulges out from the surface of the Earth on opposite sides of the Earth. These bulges correspond to places where there is high tide, and there is low tide away from the bulges. You can see that, as the Earth rotates, a particular point on it's surface continually moves from low to high tide and back again. You can also see that there is a high tide (and a low tide), for such a point, twice a day. As the Moon revolves around the Earth, you can see that it pulls the elongated shape of water around with it, causing it to rotate a full turn in about a month. This means that high tide, for a paticular point on the Earth, happens at different times each day. The Earth takes one day (by definition) to rotate once, while the Moon takes just over 27 days to orbit the Earth (actually an average of 27.3 days). This relationship is followed in the diagram, except that everything is speeded up, of course.