Is the cohesive force of water stronger than gravity? Answer: yes (look at water cling to the side of a glass). Therefore, capillary action will pull water uphill.
For an example, look at a tree. A tree is a slow motion fountain.
Or touch the end of a napkin into water and the water crawls up. That’s capillary action. Also note how it filters certain heavier substances. So the design of the napkin (sponge) can extract discrete particles from the fluid.