This is a very deep and important question. First, consider what generates the membrane potential- the 'battery' of a cell. For mammalian cells, this is the Na-K ATPase transporter. This membrane protein imports 3 Na ions and exports 2 K ions at the cost of hydrolyzing 1 molecule of ATP. What this means is that the ion concentrations within the cytosol (or equivalently, the ion gradients across the cell membrane) are set by how much energy can be extracted from hydrolyzing a molecule of ATP.
This is a critical point to understand- the membrane potential can be equivalently expressed in terms of an osmotic gradient or as a charge gradient (or both). This is called "Gibbs-Donnan equilibrium" and it can be derived from the Nernst equation which relates free energy changes to osmotic and electrical gradients. For ions with a single excess charge, a concentration gradient of 1:10 across a membrane at 30C provides a 60mV potential difference- the 'resting' potential.
So why does hydrolyzing a single molecule of ATP provide 60mV of energy? That value comes from the fact that your cells have a lot more ATP than they would have at equilibrium: the relative concentrations of ATP and ADP, [ATP]/[ADP], are *way* out of equilibrium. How far from equilibrium? The equilibrium ratio is 0.0000001, your cytosol is at 1000- that's 10 orders of magnitude away from equilibrium! Hydrolyzing ATP provides energy (free energy) as [ATP]/[ADP] falls to equilibrium- 57 kJ/mol, or 590 mV, assuming a single ATP molecule gives all it's energy to a single charge (the calculation is correct, but I can't account for the discrepancy with the resting potential). So how do your cells keep making ATP, and where does *that* energy come from?
ATP is synthesized in
mitochondria- the ATP synthase protein is located on the inner membrane of
mitochondria, functionally located at the end of the 'chemiosmotic protein circuit'. The central concept here is the same as above, but the reverse direction: movement of protons across a membrane drives the synthesis of ATP. This process is the
mitochondrial respiratory chain and begins with the breakdown of glucose into acetyl CoA, which then enters the citric acid cycle and oxidative phosphorylation, resulting the production of ATP (and another important molecule, NADH). It's important to note that the membrane potential of
mitochondria is much higher than 60mV- IIRC it's closer to 220 mV.
Why glucose (or sugars in general)? Because it burns- seriously. The process of generating ATP from glucose is chemically equivalent to combustion, only at a much slower rate, so that maximal free energy can be extracted.
An excellent book for this is "Bioenergetics", by Nicholls and Ferguson.
Edit: I guess I didn't actually answer your question- the answer is that the membrane resting potential is set by how efficiently
mitochondria convert the energy of burning sucrose into a proton gradient.