The concept to read up on is contact angle, which quantifies the qualitative concepts of hydrophobic vs hydrophilic. The closely related concepts are surface tension which results in the curvature we see.
At macro-scale, the two-phase boundary between the liquid and gas (the curved area), tends to a constant curvature, but this curvature depends on two things. One of them is the surface tension, which is a property of liquid and gas (and temperature etc). The other is pressure. There is a 3-way relation between surface-tension, curvature, and pressure, called the Young-Laplace equation.
Now we introduce the walls of the tube. Where the liquid-gas boundary surface meets the solid of the wall, is the three-phase contact line (a circle, i.e. where the curved liquid-gas boundary surface intersects the cylindrical walls if talking about a tube).
A cross section view tends to produce a characteristic value for the angle of the liquid-gas surface vs the wall, and this is called the contact angle. It is a property of all three materials!
Some solid materials will "grip" the same liquid-gas boundary more, resulting in a sharper contact angle. Literally, the solid exerts an opposing force on the liquid-gas boundary, if there is pressure attempting to push or stretch the liquid-gas boundary surface. This force is then reflected in more pressure difference on the liquid-gas boundary surface. Since the surface tension is the same (it's just a property of the liquid and gas), the resulting curvature will be more when the solid+liquid+gas combination has a sharper contact angle.
Roughly speaking, this curvature is then maintained, because if more pressure is applied, the contact line "gives way" and the entire liquid boundary moves forward, lets say, while keeping the same curvature.
Looking more closely, the next phenomenon is that the contact angle tends to have hysteresis. If you're pushing the fluid in one direction, then change it and begin to pull back the fluid, in terms of flow, then the contact angle isn't maintained exactly, but will allow some reduction before it gives way again in the opposite direction.
Looking even closer, contact angle phenomena, in practice, are affected by micro-scale geometry- i.e. surface roughness. The contact line won't give way all at once all around its circumference, but will jump in one spot, then in another, following any micro-contours of the wall. Might get caught a bit on a scratch in the glass, for instance.
Last but not least, the finest surface contamination (e.g. anything oily or soapy) is quite significant.
All this just sets up a detailed way of quantifying what happens, but doesn't answer the question for atomic scale unfortunately. Arguably into "physics" territory rather than "engineering". From what I don't actually understand, it can be approached from the direction of thermodynamics.