According to the universal law of gravitation, every object in the universe attracts other objects with a force, whose magnitude is directly proportional to the product of their masses, and inversely proportional to the square of the distance between them.
Due to the gravitational force of the moon, the water on the earth gets attracted by the moon and rises higher during the nighttime.
Hence, the law of gravitation explains the force that is responsible for tides in the sea.