The battery has a chip that talks with its cells, monitoring everything from charge level to temperature. The chip relays this information to the computer, which uses an advanced algorithm to determine the optimal charging current. It’s all part of an Apple-developed technology called Adaptive Charging, which helps prolong the lifespan of the battery.