The primary mechanism by which reverse osmosis membranes remove dissolved solids from water is through size exclusion and charge repulsion, where the membrane's pores are small enough to block the passage of dissolved ions and molecules, and the membrane's surface charge repels ions of the same charge, preventing them from passing through.
Source: Standard reverse osmosis system design principles