The resting membrane potential is the result of the movement of several different ion species through various ion channels and transporters (uniporters, cotransporters, and pumps) in the plasma membrane. These movements result in different electrostatic charges across the cell membrane. Neurons and muscle cells are excitable such that these cell types can transition from a resting state to an excited state. The resting membrane potential of a cell is defined as the electrical potential difference across the plasma membrane when the cell is in a non-excited state. Traditionally, the electrical potential difference across a cell membrane is expressed by its value inside the cell relative to the extracellular environment. 
There are a handful of crucial ions which contribute to the resting potential, with sodium (Na+) and potassium (K+) providing a dominant influence. Various negatively charged intracellular proteins and organic phosphates that cannot cross the cell membrane are also contributory. To understand how the resting membrane potential gets generated and why its value is negative, it is crucial to have an understanding of equilibrium potentials, permeability, and ion pumps. 
Em = RT/zF * log([ion outside the cell]/[ion inside of the cell]).
Em= membrane equilibrium potential
R = gas constant = 8.314472 J · K-1
T = temperature (Kelvin)
F = Faraday's constant = 9.65 x 104 C mol-1
Z will be 1 for a monovalent ion such as K+, and 2 for a divalent ion such as Ca2+ and so on. Thus the equation is:
RT/F can be simplified to 61.5 at normal body temperature.
There are two important concepts central for the understanding of any membrane potential:
The first is that the difference in the concentration gradient of an ion across a semipermeable membrane drives the direction of movement of the ion. This ionic concentration gradient, or difference across the membrane surface, is maintained by the use of energy, either primary or secondary active transport, and creates a force for movement of that ion across the membrane. Again, because of the high relative permeability of the membrane to potassium, the resulting membrane potential is almost always close to the potassium equilibrium potential. But in order for this process to occur, a concentration gradient of potassium ions must first be set up. This work is done by the Na+/K+ ATPase pump, which pumps 3 Na+ ions out of the cell and 2K+ into the cell to generate the Na+ and K+ concentration gradient.
The second is that the membrane is semipermeable to that ion. There is an ion channel that allows for the ions to pass through the membrane only when that specific ion channel is open. Thus, when the ion channel opens, the ion moves down its concentration gradient from high to low, in this case for K+ from the inside (intracellular region) to the outside (extracellular region). Note: permeability is the capability of ions to flow across the membrane even if they are moving or not (e.g. is there an ion channel present). However, conductance measures the movement of charge across the membrane.
We have discussed the concentration gradient and membrane permeability. Now, we discuss the electrostatic gradient formed. Positive and negative ions tend to pair with one another in an ionic solution, as opposites attract. However, the movement of only the cation from the inside of the cell to the outside of the cell leaves behind a negative anion, and thus the inside of the cell becomes more negative, while the outside of the cell becomes more positive. This generates an electrostatic gradient that builds up over time.
Eventually the negative charges inside the cell start to exert a force to keep the positively charged K+ ions inside the cell, a force that opposes the movement of the ions down the concentration gradient. When this negative electrostatic charge is opposite the force of the concentration gradient, there is no movement of the ions. This situation is called the equilibrium potential for that ion, which is calculated by the Nernst equation. Note: we must stress that only a few ions need to move across the membrane to generate the membrane potential, and thus do not significantly change the ion concentration gradient.
Since multiple ions contribute to the resting membrane potential, the Goldman-Hodgkin-Katz equation, and not the Nernst equation, is used to calculate the membrane potential.  Since the ion with the greatest conductance across the membrane at rest is potassium, the potassium equilibrium potential is the major contributor to the resting membrane potential. However since some sodium and other ions leak out of the cell at rest, and so the resting membrane potential is a bit more positive at -70 mV. 
Permeability refers to the ability of ions to cross the membrane, and is directly proportional to the total number of open channels for a given ion in the membrane. The membrane is permeable to K+ at rest, because many channels are open. In a normal cell, Na+ permeability is about 5% of the K+ permeability or even less, whereas the respective equilibrium potentials are +60 mV for sodium (ENa) and −90 mV for potassium (EK). Thus, the membrane potential will not be right at EK, but rather depolarized (more positive value) from EKa. Thus, the cell's resting potential will be approximately −73 mV.
All cells within the body have a characteristic resting membrane potential depending on their cell type. Of primary importance, however, are neurons and the three types of muscle cells: smooth, skeletal, and cardiac. Hence, resting membrane potentials are crucial to the proper functioning of the nervous and muscular systems.
Upon excitation, these cells deviate from their resting membrane potential to undergo a rapid action potential before coming returning to rest.
For neurons, the firing of an action potential allows that cell to communicate with other cells via the release of various neurotransmitters. In muscle cells, the generation of an action potential causes the muscle to contract.
For the vast majority of solutes, intracellular and extracellular concentrations differ. As a result, there is often a driving force for the movement of solutes across the plasma membrane. The direction of this driving force involves two components: the concentration gradient and the electrical gradient. Regarding the concentration gradient, a solute will move from an area where it is more concentrated to a separate area with a lower concentration. Regarding the electrical gradient, a charged solute will move from an area with a similar charge towards a separate area with an opposite charge. All solutes are affected by concentration gradients, but only charged solutes are affected by electrical gradients.
In the absence of other forces, a solute that can cross a membrane will do so until it reaches equilibrium. For a non-charged solute, equilibrium will take place when the concentration of that solute becomes equal on both sides of the membrane. In this case, the concentration gradient is the only factor that produces a driving force for the movement of non-charged solutes. However, for charged solutes, both the concentration and electrical gradients must be taken into account, as both influence the driving force. A charged solute is said to have achieved electrochemical equilibrium across the membrane when its concentration gradient is exactly equal and opposite that of its electrical gradient. It’s important to note that when this occurs, it does not mean that the concentrations for that solute will be the same on both sides of the membrane. During electrochemical equilibrium for a charged solute, there is usually still a concentration gradient, but an electrical gradient oriented in the opposite direction negates it. Under these conditions, the electrical gradient for a given charged solute serves as an electrical potential difference across the membrane. The value of this potential difference represents the equilibrium potential for that charged solute. 
Under physiological conditions, the ions contributing to the resting membrane potential rarely reach electrochemical equilibrium. One reason for this is that most ions cannot freely cross the cell membrane because it is not permeable to most ions. For instance, Na+ is a positively charged ion that has an intracellular concentration of 14 mM, an extracellular concentration of 140 mM, and an equilibrium potential value of +65 mV. This difference means that when the inside of the cell is 65 mV higher than the extracellular environment, Na+ will be in electrochemical equilibrium across the plasma membrane. Moreover, K+ is a positively charged ion that has an intracellular concentration of 120 mM, an extracellular concentration of 4 mM, and an equilibrium potential of -90 mV; this means that K+ will be in electrochemical equilibrium when the cell is 90 mV lower than the extracellular environment.
In the resting state, the plasma membrane has slight permeability to both Na+ and K+. However, the permeability for K+ is much greater due to the presence of K+ leak channels embedded in the plasma membrane, which allow K+ to diffuse out of the cell down its electrochemical gradient. Because of this enhanced permeability, K+ is close to electrochemical equilibrium, and the membrane potential is close to the K+ equilibrium potential of -90 mV. The cell membrane at rest has a very low permeability to Na+, which means Na+ is far from electrochemical equilibrium and the membrane potential is far from the Na+ equilibrium potential of +65 mV.
The equilibrium potentials for Na+ and K+ represent two extremes, with the cell’s resting membrane potential falling somewhere in between. Since the plasma membrane at rest has a much greater permeability for K+, the resting membrane potential (-70 to -80 mV) is much closer to the equilibrium potential of K+ (-90 mV) than it is for Na+ (+65 mV). This factor brings up an important point: the more permeable the plasma membrane is to a given ion, the more that ion will contribute to the membrane potential (the overall membrane potential will be closer to the equilibrium potential of that 'dominate' ion).
Na+ and K+ do not reach electrochemical equilibrium. Even though a small amount of Na+ ions can enter the cell and K+ ions can leave the cell via K+ leak channels, the Na+/K+ pump constantly uses energy to maintain these gradients.  This pump plays a large role in maintaining the ionic concentration gradient by exchanging 3 Na+ ions from inside the cell, for every 2 K+ ions brought into the cell. We must stress that while this pump does not make a significant contribution to the charge of the membrane potential, it is crucial in maintaining the ionic gradients of Na+ and K+ across the membrane. What generates the resting membrane potential is the K+ that leaks from the inside of the cell to the outside via leak K+ channels and generates a negative charge in the inside of the membrane vs the outside. At rest the membrane is impermeable to Na+, as all of the Na+ channels are closed.
Both the generation and maintenance of the resting membrane potential are of great importantance in excitable cells (neurons and muscle). Conditions that alter the resting membrane potential of these cells can have a profound impact on their proper functioning. For instance, hypokalemia is a state in which there is a lower than normal amount of K+ in the blood. As a result, there is an enhanced concentration gradient that favors the flux of K+ out of cells. This results in hyperpolarization of the cells, and requires a greater stimulus to achieve action potential. This leads to a more negative potential in cardiac muscles as a result of the recovery of sodium channel inactivation. Low potassium levels lead to delayed ventricular repolarization, which can contribute to reentrant arrhythmias. Increased levels of potassium results in depolarization of the membrane of cells. This depolarization inactivates sodium channels, which increases the refractory period (and may lead to major arrhythmias, for example). Major electrolytes abnormalities can lead to muscle spasms of skeletal muscles, dysrhythmias of cardiac muscles, and seizures of CNS neurons. 
Note: Depolarization refers to the increase in positivity of membrane potential while hyperpolarization refers to the increase in negativity of membrane potential. These two events commonly occur in excitable cells that have an action potential, whereas most other cells have a constant resting membrane potential that does not change. Most are familiar with the concept of depolarization when referring to an action potential. For an action potential, an initial graded depolarization of the membrane results in opening of the voltage gated sodium channels. As large numbers of positive sodium ions rush into the cell through open channels,the interior of the cell becomes more positively charged, the membrane potential becomes more positive, and depolarization occurs. However, depolarization does not always result in an action potential. Action potentials occur only when the graded potentials (initiated by synaptic activity) are of significant strength to cause the membrane voltage to pass a threshold, after which the voltage gated sodium channels open. 
|||Wright SH, Generation of resting membrane potential. Advances in physiology education. 2004 Dec; [PubMed PMID: 15545342]|
|||Enyedi P,Czirják G, Molecular background of leak K currents: two-pore domain potassium channels. Physiological reviews. 2010 Apr; [PubMed PMID: 20393194]|
|||Veech RL,Kashiwaya Y,King MT, The resting membrane potential of cells are measures of electrical work, not of ionic currents. Integrative physiological and behavioral science : the official journal of the Pavlovian Society. 1995 Sep-Dec [PubMed PMID: 8788226]|
|||Clay JR, Determining k channel activation curves from k channel currents often requires the goldman-hodgkin-katz equation. Frontiers in cellular neuroscience. 2009 [PubMed PMID: 20057933]|
|||Tamagawa H, Mathematical expression of membrane potential based on Ling's adsorption theory is approximately the same as the Goldman-Hodgkin-Katz equation. Journal of biological physics. 2019 Mar [PubMed PMID: 30392060]|
|||[PubMed PMID: 22196327]|
|||Morth JP,Pedersen BP,Toustrup-Jensen MS,Sørensen TL,Petersen J,Andersen JP,Vilsen B,Nissen P, Crystal structure of the sodium-potassium pump. Nature. 2007 Dec 13; [PubMed PMID: 18075585]|
|||Castro D,Sharma S, Hypokalemia . 2018 Jan [PubMed PMID: 29494072]|
|||Simon LV,Farrell MW, Hyperkalemia . 2018 Jan [PubMed PMID: 29261936]|
|||Brown DA,O'Rourke B, Cardiac mitochondria and arrhythmias. Cardiovascular research. 2010 Nov 1 [PubMed PMID: 20621924]|
|||Grider MH,Jessu R,Glaubensklee CS, Physiology, Action Potential . 2020 Jan [PubMed PMID: 30844170]|