Drone Batteries have a small plug which has many wires running to it. This connector plug into the charger but really doesn't ever do anything else. The purpose of this connector is to balance the lithium battery cells.
Lithium battery cells, both LiPo and LiIon cells, cannot exceed 4.2V and go below 3.0V for LiPo, and 2.5V for LiIon chemistries. Some high voltage LiPo batteries can go marginally higher to 4.25V. The charger can read the voltage of each cell, and after each use, the charger will individually charge or discharge each cell using the balance wires, to make sure that each cell is the same voltage relative to each other.
When the battery is in use, each cell has an internal resistance, which I will discuss in another post, which affects how the battery discharges. Because of this variation, the end voltage of each cell may be slightly different at the end of the flight. This is why we do not recommend using the battery to 2.5V per cell, because potentially some cells could be below 2.5V and irreversible chemical damage has occurred.
Some chargers balance the cells after the main CC/CV charge is complete, and some balance the cells during the CC/CV charge. I will discuss CC/CV charging in another post. The wires of a JST-XH balance lead are typically ground, (0V), the first cell, second, third, up to the highest voltage in series. So this would follow 0V, 3.7V, 7.2V, 11.1V, 14.8V, 18.5V, 22.2V, and so on. Never swap around the wire order. Some batteries do not use JST-XH balance lead types, some use JST-PH connectors with other wire orders, I listed the most common variation of JST-XH with a typical wiring layout. Always be sure to verify wiring before plugging into a charger. The charger may not break, but it is worth a look. At Upgrade Energy, we try to make our balance leads a sensible length, it is not good to have very short balance leads that don't reach the charger, or very long leads that can get tangled up and ripped up in the event of a crash. We optimize our balance leads so the lithium battery and the drone stays safe.