In the process of SWRO, semi-permeable membrane is placed between two compartments.'Semi-permeable' means that the membrane is permeable to some species and not permeable to others. Assume that this membrane is permeable to water but not to salt.
Then, place a salt solution in one compartment and pure water in the other compartment. The membrane will allow water to permeate through it to either side but salt cannot pass through the membrane.
Two applications are typical: