Salt for foods is often obtained from salt deposits under the ground. It is extracted using solution mining and then evaporated to give pure salt.
This animation shows what happens:
The water must be evaporated to make the salt crystals.
Take a look at how a brine evaporator works.