Changing levels of water in the ocean is called tide. In creating tides, the moon plays a very specific role. Not only the moon but also the sun is responsible for fluctuation caused in water level to some extent. The moon is closer to earth, so it is mainly responsible for causing tides.
Gravitational force of the moon causes oceans to bulge out in the direction of the moon and other bulge occurs in opposite side as earth is also being pulled by the moon. Each day two times tide causes with having difference of 12 hours and 25 minutes– from low tides to high tides and vice versa.
Tides are very high and very low if the sun and the moon are aligned because of strong gravitational force and if not so, gravitational force of both are cancelled and neap tides cause, that is least height of tides. The height of tides varies because of the varying distance of the moon with earth.