Mechanisms for the selective rejection of solutes in nanofiltration membranes