During evaporation, heat is used to change water from a liquid to a vapour state. When water contains other products, such as sugar or salt, evaporation can cause the product to remain.
Salt water evaporates much like unsalted water, although salt can raise the boiling point of water, making it evaporate more slowly. Through the evaporation process, the water leaves the salt behind.
Sugar dissolves completely in water, and once it is dissolved, it can be difficult to separate. However, when sugar water is evaporated, sugar crystals do remain.
People have been waiting for seawater to evaporate, then collecting the remaining salt for thousands of years, and much of today's table salt is still created in evaporation ponds through this process.