Tides are primarily caused by the gravitational pull of the Moon, with some influence by .
The Moon , which is our closest astronomical neighbour, exerts a large pull on the Earth (it is equal and opposite to that exerted by the Earth on the Moon in accordance with Newton’s Third Law of Motion). It is quite correct to say that while the Earth’s gravity holds the Moon in orbit, the Moon too holds the Earth in its orbit. And while the Moon’s pull is nowhere near as significant on the Earth as the Earth’s on the Moon, the Moon is able to exert influence on the Earth’s water. See the image below:
The Moon pulls on the “Moon side” of the Earth and creates a high tide water bulge.
On the “Low tide” sides of the Earth, water rushes out from those locations to the high tide locations.
And lastly, on the “other High tide side”, the bulge there is created not by the Moon but instead by the tendency of the water to want to remain in place (i.e. inertia, Newton’s Second Law of Motion). The gravitational pull of the Moon is weakest here and so water does not rush to the the Moon side – instead it stays put. This makes the tidal bulge less but the water level is still higher than in the low tide regions.
Also something to keep in mind is that the tides follow the position of the Moon – they are not directly under it. Because it takes time for the water to be pulled by the Moon, it is constantly chasing the Moon and never catching up – so the tidal bulge on the Moon side of the Earth is not directly underneath but a small angle off (and the rest of the tidal bulges are equally delayed as well).
Ok – so that’s the Moon. Now let’s talk about the Sun.
While the Sun is far more massive than the Moon, it so much much further away and so that reduces it’s gravitational pull by a huge factor (gravity fades as a function of the distance squared between the two objects). The Sun, then, doesn’t cause tides the way the Moon does. It does, however, pull to some degree and so causes “Solar tides”. And depending on the angles of the Sun and Moon to Earth, it can either create constructive or destructive interference – or in other words can make tides higher (constructive) or lower (destructive). Look at the image below:
In the top diagram, the astronomical positions needed for Spring Tides are shown (Full and New Moons), which are higher than normal high tides and lower than normal low tides (constructive interference). Both the Moon and Sun pull in the same direction and so cause tidal bulges to be greater.
In the bottom diagram, the astronomical positions needed for Neep Tides are shown (Quarter moons), which are lower than normal high tides and higher than normal low tides (destructive interference). The Moon and Sun pull tidal bulges in opposite directions and so partially cancel each other out.