If you have poured tea from a mug you’ll intuitively know what a Coanda effect is. To put it simply, the Coanda effect is the phenomenon where fluids like water tend to follow and stick to a contour of an object.
So what happens here? When the water flows out of the mug, the water molecules encounter the air molecules and try to drag them along due to viscosity. As the air molecules under the mug get dragged off, the pressure at that spot, which is relatively constrained compared to the other side, decreases (Bernoulli’s principle). And as the pressure is higher at the top of the water than on any other side, the water reaches equilibrium by moving towards the low-pressure region, which is what makes it to stick to the surface of the mug.