Consider the earth's orbit relative to the moon as determined by the moon's gravity. Regard the earth as sufficiently approximately spherical. The moon's gravity varies between parts of the earth that are closer or farther from the moon. The orbit of the earth as a whole is calculated correctly (as Newton proved) as if the entire mass of the earth were concentrated at the center. A point on the earth's surface facing the moon is closer to the moon than the center and so feels additional force. This force tends to create a bulge facing the moon. The size of the bulge is an equilibrium between the increased attraction of the moon there and the gravity of the earth pulling on the bulge. On the side of the earth away from the moon the moon's gravity is less and centrifugal acceleration creates a bulge. According to the mathematics the two bulges are of the same size. Because the moon always keeps the same face to the earth, the bulges on the near and far sides of the moon stay in place. Since the earth rotates in 24 hours the bulges on the earth move.