The more energy you force into the battery, the quicker it will charge, but it also generates more heat. The hotter the battery gets, the more chance there is of swelling and a failure of one of the many layers within the battery that could cause a short circuit or similar fault leading to potentially fiery consequences.
Therefore, the speed of charging is carefully regulated by multiple smart systems, balancing the amount of current forced into the battery, the heat of the cell and its surrounding components.
It may appear to be a dumb electricity cable, but when you plug in your device a series of checks are made before and during charging. For instance, Huawei’s 40W fast charging for its smartphones, among the fastest currently available, runs through a five-gate protection system when you plug the phone in. This includes the charger identifying itself, the cable and connection being checked, the phone figuring out the maximum power draw, and constant monitoring of the thermal safety limits of the battery and charging circuit. Others such as OnePlus’s fast charge offload some of the charging control circuitry to the charger to help keep heat away from the battery.
Needless to say, the higher the density of the components and battery, the more difficult it is to charge it fast and safely.