Plants lose water meanwhile carbon dioxide enters plant leaves through stomata, the small pores on the leaf surface. The release of water is called transpiration. It is a passive flow that has a relatively little benefits for the plant except for cooling down during moments of high light intensity.
Rained or condensed water evaporates also from soil and plant surfaces. The sum of transpiration and evaporation of a forested ecosystem is called evapo-transpiration.
If a plant is short of water, it closes the stomata. However, the action shuts down also the inflow of carbon molecules and thus the photosynthesis also hinders. Therefore, plants try to optimize the function of stomata.