LM339 Lipo Battery Voltage Tester Circuit - How does it work?
D1 acts as a cheezy shunt voltage regulator.  LED's tend to hold their terminal voltages fairly constant over a wide range of input current (although they do get brighter or dimmer).  So the voltage divider consisting of R5 through R8 is the reference.

If you really want this to work well, spend the money and use a real shunt reference instead of D1.