Typically using extremely low bias comparators, which due to their low current, operate extremely slowly (~10us for the fastest ones, up to ~ms). They are internally constructed with MOSFETs, gigohm resistors and CMOS logic.
The biggest challenge in designing such circuits is getting a reliable voltage reference. The traditional bandgap reference, as with most circuits, exhibits noise proportional to sqrt(I). At low currents, shot noise dominates, meaning, the voltage fluctuates up and down in rather huge steps (~mV?). For a battery monitor, this makes it very difficult to precisely gauge state-of-charge and cutoff.
Trying to build a discrete version is kind of silly, because you need that low noise reference at some point. Constructing a bandgap from discrete transistors is impractical (too temperature sensitive), and may not have good results anyway (a 2N3904 is probably 10,000 times larger than the transistors used for internal references, so the current density will be extremely low, and therefore hFE will be poor). Using a commercial micropower reference is kind of cheating (it's an IC, so why not add a few more internal transistors for one of those ref-comparators or full on monitoring chips), and not quite good anyway (often, the comparison itself will be accomplished by monitoring when the bandgap turns on -- this is how many voltage regulators, like LM317, operate, using the reference as the error amplifier).
Tim