Hmm, it's been a while since I studied electrochemistry. I know it has to do with the change in Gibbs Free Energy (ΔG) for the chemical reaction involved, and ΔG depends on the concentration of ions in the battery solutions, which in turn depends on the charge state of the battery.
This site goes into it in detail, but assumes you are familiar with Gibbs Free Energy:
http://www.science.uwaterloo.ca/~cchieh/cact/c123/nernsteq.html
If nobody else can provide a better answer, I'll recommend you look at an introductory chemistry book (perhaps high school honors level, or college freshman level) that has a chapter devoted to electrochemistry. You'll need to be familiar with concepts like enthalpy and free energy, which would also be covered in such a book.
In particular, I can recommend the book Chemistry by Steven and Susan Zumdahl.