How do battery chargers deal with variations between cells?
Some battery chemistries self-balance well enough to allow this aspect to be ignored, or to be accommodated by compromise solutions, but many modern batteries require specific attention to this aspect.

With eg LiIon batteries the normal approach is to use "balancing' circuitry specifically aimed at ensuring cell balance. Various approaches are possible. It is possible to cut off charge to cells which reach a certain voltage first, so that they "wait for the others", or to reduce charge rates on higher voltage cells so that the others 'catch up' 

With LiFePO4 chemistry -  some manufacturers make 12V 4 cell batteries for automotive use. Some have exposed intercell connections and others provide no access. The ones with no access claim that it is not needed - but experienced sellers who offer a range of such batteries may suggest that such versions be used only for 'float' operation and that deep discharge applications employ balancing.  

4 cell lead-acid  car batteries have been used for decades with no attempt to address balancing issues. The application of topping or boost cycle occasionally serves to bring up any lower voltage cells. However, serious users of large capacity lead acid batteries check balance on a per cell basis, measure and record acid specific gravity per cell and concern themselves with issues such as acid stratification. 

Ye olde NiCd cell packs were noticeably prone to unbalance issues when more than about 3 cells were used in series. When V_cell_min x N > V_cell_max x (N-1) for N cells then it is possible to have N-1 fully charged cell while one cell can have less or even no charge while the battery voltage is in spec. Eg NiCd battery. 6 cells. Vmin/cell = 1V say. Vmax/cell = 1.2V say.
5 x 1.2 = 6V, 6 x 1.0 = 6V.  So 5 charged cells and 6 discharged cells can have the same voltage. As V_cell_charged is actually > 1.2 V "we have problems". NimH is less prone to imbalance issues than NiCd BUT modern NimH cells MUST NOT be trickle charged* -  so, while it was often possible to balance a NiCd pack by long enough trickle charging, this must not be done with NimH cells. 

*When a NimH cell is overcharged Hydrogen &amp; Oxygen gas are evolved. Earlier NimH cells used a recombination system that converted the H2 + O2 back to water. As energy densities rose manufacturers dispensed with the recombination system so as to pack in more active material. This means that in modern NimH cells, if ANY gas is produced the water is lost permanently - cell pressure will rise, if vents are provided, gas will escape. If vents are NOT provided gas will (still escape) - Hydrogen can escape from  Houdini proof confinement (THROUGH steel if necessary - embrittling it on the way). Oxygen has a harder job but will either escape via leakage or worst case cause an explosion.  

The limit for inclusion of recombination system was was somewhere in the 1500-1800 mAh range AFAIR. By about 2000 mAh trickle charging was not allowed and certainly at 2500 mAh + capacity NimH cells will be damaged by even extremely small rates of trickle charging. 

I long long ago in the early days of NiCd batteries saw a solid metal encased NiCd C cell that had exploded after gross overcharging, but that was rare.

_________________

TI -  Battery Cell Balancing:
What to Balance and How  - 8 pages

TI - Cell balancing buys extra run time
and battery life

Battery University - BU-803a: Cell Matching and Balancing  Discover that quality cells are the best foundation for a lasting battery pack

Electropaedia - Cell Balancing

LT  - Battery Cell Balancers


LT8584 - 2.5A Monolithic Active Cell Balancer with Telemetry Interface
LTC3300-1 - High Efficiency Bidirectional Multicell Battery Balancer


LTC3300: