The tendency for water molecules to stick together is called cohesion.

Cohesion due to hydrogen bonds allows water to be pulled from beneath the soil to great heights in trees.

Note: Trees take up water via roots, while photosynthesis (the process of producing their food with light) occurs in leaves.