I might be wrong here, but how can capillary action ever cause water to overspill the top of the capillary?

IIRC water flow in xylem in plants is not capillary action but is driven by evaporation of water from the leaves, ie the top of the column. No mystery what the energy source is there (heat).