I have been wondering why situation described in the picture below happens

Why does the water/milk or any liquid poured from the mug/bottle flow along the surface of the vessel instead of leaving it and falling.
It's a weak bond called a hydrogen bond.
It bonds to other elements as well.

https://en.wikibooks.org/wiki/Structural_Biochemistry/Chemical_Bonding/Hydrogen_bonds