The tides are due to the gravitational pull of the Moon and the Sun on the Earth. Because the gravitational force decreases as the distance squared, the part of the Earth that is closer to the Moon or the Sun is pulled a little extra and a bulge is created.