For most cells, the potassium concentration is great inside and relatively low outside because of the Na+,K+ pump. Most cells have potassium-selective ion channels that allow some potassium ions to diffuse outward through the cell surface membrane. As they do so, those ions carry positive electrical charges to the outside, thus creating electropositivity outside the membrane and electronegativity inside because of negative anions that remain behind and do not diffuse outward with the potassium. Within a millisecond or so, the electric potential difference between the inside and outside, called the diffusion potential, becomes great enough to block further net potassium diffusion to the exterior, despite the high potassium ion concentration gradient. A typical potassium diffusion potential is about 100 millivolts inside negative. Altered potassium diffusion potentials can make hyperkalemia and hypokalemia dangerous medical conditions.
See: resting membrane potential
Guyton Medical Physiology Textbook, Chapter 5.