Cells can gain or lose water by the process of osmosis. This depends on the water concentration of the solution inside the cell compared to water concentration of the solution outside the cell.

The water concentration can be thought of as the proportion of a solution that is water. Solutions with a high concentration of solute molecules, such as sugars or salts, have a low concentration of water molecules and vice versa.

A beaker with a selectively permeable membrane dividing it in two.  The beaker contains water and sugar molecules.  On the left hand side there is a higher water concentration and lower sugar concentration. On the right hand side, there's lower water concentration and higher sugar concentration.

Definition of osmosis

The net movement of water from a region of high water concentration to a region of low water concentration through a selectively permeable membrane.

A beaker with a selectively permeable membrane dividing it in two.  Water molecules pass through the membrane from the side with the higher concentration to the side with the lower concentration.

This means osmosis is a special case of diffusion: the diffusion of water. In the diagram above solution two gains water faster than it loses sugar.

This is because the selectively permeable membrane lets water molecules pass through much more rapidly than it lets sugar molecules pass through.