High and low tides are caused by the gravitational pull of the moon. Both the Earth and moon are constantly pulling at each other, but because they are both rather solid pieces of rock the effect is hardly noticeable. Where the effect is more obvious is on shifting water levels. As water is a liquid, it moves far easier than solid rock, resulting in two high tides a day and two low tides.
First High Tide
The first high tide of the day is the result of the moon's gravitational pull on the oceans of the Earth. The overall sea level on the side of the Earth closest to the moon rises slightly, causing a high tide at shores closest to the moon. Yet this explains only one high tide, when there are two each day.
Second High Tide
The second high tide is rather more complex. The pull of gravity is inversely proportional to the square of the distance. What that means is that as you move further away from a heavy object like the moon the gravity dramatically decreases. This means that the gravitational pull of the moon is far weaker on the far side of the Earth than on the side closest to the moon. So weak, in fact, that the water level actually rises as the moon's pull is not enough to squeeze it closer to the sea bed. This causes the second high tide of the day.
The low tides take place at right-angles to the moon, in between the two types of high tides. At this point the gravity of the moon is strong enough to prevent the oceans lagging behind the Earth, but not strong enough to pull them toward itself. The noticeable effect of this is a low tide.
The sun's mass is 27 million times that of the moon, but it is also far further away. Its effect on the oceans is so small compared to that of the moon that it is barely noticeable. Despite this, when both the sun and moon are on the same side of the planet the gravitational pull is combined enough to cause particularly high tides.