The moon's gravitational force does indeed affect the tides on Earth, but the effect is not noticeable on smaller bodies of liquid, such as the coffee in a cup. The key factor here is the difference in scale and the gravitational interaction between objects.
The gravitational force between two objects depends on their masses and the distance between them. While the moon is relatively large and has a significant mass, the coffee in a cup is a relatively small amount of liquid with a significantly smaller mass. Additionally, the distance between the moon and the coffee in a cup is much greater compared to the distance between the moon and the Earth's oceans.
The gravitational force exerted by the moon follows an inverse square law, which means that the force weakens as the distance increases. The moon's gravitational force affects the tides because the Earth's oceans cover a vast surface area, allowing the gravitational force to have a noticeable effect over a large body of water.
On the other hand, the coffee in a cup is contained within a small volume and its mass is significantly less than that of the Earth's oceans. Consequently, the gravitational force between the moon and the coffee is extremely weak, and any gravitational effects would be negligible compared to other forces acting on the liquid, such as surface tension or the container's own stability.
In summary, while the moon's gravitational force can influence large bodies of water like the tides, its effect on smaller amounts of liquid, such as the coffee in a cup, is so minimal that it is virtually imperceptible.