All batteries have an equivalent capacitance, ESR and chemical cell voltage from which SoC can be computed by cumulative discharge current or floating cell voltage or loaded cell voltage much higher than the ESR of the battery. There is a secondary high ESR and larger C value as well due to absorption characteristics. (2nd order effects)
The most common method for Alkaline is float voltage or pre-determined load measuring V drop due to ESR rise as SoC drops and for LiPo's the cumulative I*t discharge is more popular.
Actual numbers depend on the battery quality and Ah ratings which affect ESR, C values as well as the hidden absorption RC value when the resistive voltage climbs back up when load is removed.
Try this quick N dirty design I did in Java
https://goo.gl/EYl7ci
The LED current can be adjust with 470R, the series diode is not needed for comparators (open collector) and the diode can be any Silicon diode or even an LED with R adjustments used as a reference voltage.
Ignore the circuit used to test it with a slow sweep, but there are two sliders, Vbat and Threshold adjust. The 100k to 7.5V is shown in scope as mV above 7.5V to show hysteresis and LED ON thresholds for low battery. Using a 0.01Hz sweep.