Surface tension keeps the fluid in contact with the solid.
If the fluid does not wet the solid, it will drop off the edge. This gets into what happens when a fluid comes in contact with a discontinuity on a solid surface. Typically, real surfaces have rounded edges, and so a wetting fluid will follow the surface until gravity or some other force pulls the fluid away. Given two immiscible fluids in contact with a soild, the two fluids form an interface which exists at a certain contact angle to the solid surface. Call this the equilibrium contact angle.