Most biological membranes have quite different permeabilities for the biologically important ions.
Thus in most cases chloride crosses the membrane much more easily than its counter-ion sodium under diffusion pressure to move inward. The separation of Na and Cl at the boundary builds up potential difference which eventually results in just as many Cl ions being repelled back out of the cell as are moving inward because of the concentration gradient. When this state is reached, the equilibrium potential for chloride has been attained. Similarly, for potassium which is under a chemical potential to diffuse outward, the membrane is relatively more permeable than to chloride, resulting in a separation of charge for that ion pair as well and an equilibrium potential. The equilibrium potential is related to the logarithm of the ratio of internal and external concentrations of the diffusible ion as described by the Nernst potential.