The cell walls act as a semipermeable membrane that only let water through. Because the water outside the root cells has a lower salt concentration water starts moving into the root cells due to osmosis. The water entering the plant fills up the cells and makes the plant sturdy. Osmosis, however, works in both directions.
A cell placed in a salt solution. This cell will lose water as the water moves by diffusion from higher to lower concentration. The cytoplasm of this cell has shrunken in a process called plasmolysis. (The size of the symbols for water represent the relative concentration: larger symbol = more water.)