Dialysis is a common biochemistry technique for buffer exchange and desalting. It separates molecules by diffusion through a semipermeable membrane, which lets small molecules pass while holding larger biomolecules inside the sample.
The membrane is the key part of the setup. Its pores create a molecular weight cutoff, so a membrane such as a 10 kDa membrane usually keeps molecules larger than 10 kilodaltons inside. This cutoff is not exact, because membranes have a range of pore sizes.