We are talking about two different chemical reactions here, both of which are prevalent in biological systems. The first reaction is the dehydration reaction. This involves the loss of water from a molecule. It occurs most commonly when the hydroxyl group (OH) of an alcohol is eliminated to produce a double bond. A hydrogen cation (called a proton) is removed from a carbon atom adjacent to the alcohol. The resulting negatively charged pair of electrons goes between the carbon atoms to make a double bond, and the OH group is eliminated. The H+ and OH- groups join to become water (H2O). A general example of propanol dehydrating to propene is shown below.
CH3-CH2-CH2-OH ---> CH3-CH=CH2 + H2O
The second reaction is a hydrolysis reaction. This is where an ester group is reacted with a water molecule to produce a carboxylic acid and an alcohol. An example is shown below.
Et-C(O)-OCH3 + H2O --> Et-C(O)-OH + CH3OH
The water molecule essentially attacks the ester carbonyl carbon and the alcohol is removed. So the water molecule becomes part of the carboxylic acid. This is all a little hard to draw out precisely here, so see the images in the links below.