It is maintained primarily through the maintenance of a sodium and potassium gradient across the cell membrane. The concentration of sodium is high outside the cell, extra-cellularly, and the potassium concentration is higher inside the cell, intra-cellularly. An ion pump called Na+K+ ATPase pumps 3 sodium ions out of the cell in exchange for 2 potassium ions which enter into the cell. The potassium ions leak back out of the cell via open potassium channels down a chemical gradient. This all contributes towards the inside of the intra-cellular side of the membrane being slightly more negative and the extra-celullar portion being slightly more positive. Sodium ions do leak back into the cell but at much slower rate than the potassium leaks out, this is why the membrane doesn't progressively get more and more negatively charged.