Membrane-based processes, such as reverse osmosis (RO) and nanofiltration (NF), are widely used for water purification and desalination due to their high energy efficiency and exceptional solute-water selectivity. Nevertheless, the fundamental, molecular-level mechanisms governing ion selectivity are still not fully understood. This study explores ion selectivity in polyamide desalination membranes, focusing on the partitioning and diffusion mechanisms of co-ions and counterions. Our experimental and molecular simulation results reveal that electrostatic interactions play a key role in impeding co-ion partitioning while enhancing their diffusion. The results further suggest that ion selectivity is predominantly controlled by the partitioning step, particularly the selective partitioning of co-ions. This finding highlights the importance of focusing on ion partitioning at the water-membrane interface to improve membrane ion-ion selectivity. In addition, our results point out to a trade-off between partitioning and diffusion, requiring careful tuning of these processes. Overall, this study provides the scientific foundation for molecular design of membranes with high ion-ion selectivity.