Water is transported inside plants by tube-like cells called xylem. The process relies on both osmotic pressure and capillary action.
Water is first absorbed by a plant's porous roots after rainfall and passes into the root xylem. Then, by way of osmotic pressure, the water is moved up the plant's stem or trunk. Also referred to as root pressure, osmotic pressure cannot move the water very high up the plant; about 20 feet at most. In a tall tree that would not be enough, so capillary action must take over at this point.
When water evaporates out of leaves, the void left behind causes the water in the xylem below to be pulled upwards. When combined with capillary action, these processes allow water to reach all parts of the plant.