The cell membrane maintains ion concentration gradients between the intracellular and extracellular spaces through selective permeability to ions like sodium, potassium, and chloride. The resting membrane potential of -70 mV is established by the membrane being more permeable to potassium than sodium, resulting in a net outward flow of positive potassium ions and leaving the intracellular space negatively charged. When the membrane is stimulated and sodium channels open, sodium rapidly enters the cell, depolarizing the membrane towards its sodium equilibrium potential. Subsequently, potassium channels open, allowing potassium to efflux and repolarize the membrane back to its resting potential. This coordinated sequence of ion channel openings and closings generates an action potential that propagates along excitable cell membranes like neurons.