When multiple rechargeable battery cells are wired in series, to achieve a higher voltage battery pack, cell balancing may be needed.
A set of cells connected in series will all see the same current, whether providing it as they are discharged or accepting as they are charged. In a perfect world, if all of the cells have the same initial state of charge (SoC) and the same capacity then they would charge and discharge equally. However, slight differences in capacity mean that individual cells with a slightly lower capacity can become more discharged andthen be slightly overcharged, which will then result in their capacity reducing further, over multiple charge/discharge cycles.
The solution to this is to use battery controller IC’s that provide cell balancing.
Passive balancing
Burn off excessive charge from overcharged cells using resistors.
Simple, but a downside catch is that energy is wasted by doing this (although less energy lost than not doing it),
Active Balancing
Switches allow energy to be moved between cells.
A lovely solution from an energy point of view, but harder and more complex to achieve.
Lossless balancing
Allows cells to be switched in and out during charging.
Great solution, but 2 switches needed per cell that need to switch the full current.
Runtime balancing
A DCDC converter for every cell, lots of complexity and cost and DCDC converter efficiency needs to be taken into account.
Good resources
https://circuitdigest.com/article/cell-balancing-techniques-and-how-to-use-them
https://www.batterydesign.net/cell-balancing/