in the simplest case, illustrated here, if the membrane is selectively permeable to potassium, these positively charged ions can diffuse down the concentration gradient to the outside of the cell, leaving behind uncompensated negative charges. the separation of charges is what causes the membrane potential.