The common belief that overnight charging kills the battery life of the mobile device is also a myth. Nowadays smartphones are equipped with charging management software which makes the process automatic, and it means that there is no need to worry about plugging the phone to the charger every night. According to Apple, the iPhone stops charging when it is completely charged and the phone is safe to stay overnight plugged to the power source.
There are also some features for managing charging on Android devices. The main problem is not just keeping the phone plugged in overnight. It is the combination of battery charge, the time of charging and temperature. The lithium-ion batteries usually lose some of their capacity due to chemical aging but the higher temperature may speed up the process.
Apple warns that charging or even using the iPhone when the temperature exceeds 35°C may permanently decrease the battery life.
That being said, the way one charges his phone is not irrelevant to battery health. If a user maintains a high level of charge for a prolonged period of time, then he risks increasing the wear on the battery. This is the reason why manufacturers have come up with technologies such as Optimized Battery Charging, Adaptive Charging, and charge limits.
Optimized Battery Charging technology decreases the time that an iPhone spends in full charge mode, while Pixel's Adaptive Charging is capable of postponing the final stage of charging until just before the moment when the user unplugs the phone. It is also possible to set a maximum charge limit at 80%, should long-term battery health be considered important.
Overall, one can be sure that charging his phone overnight does not pose any dangers, especially with the use of a modern device with optimization technology. The main enemies of battery health include overheating and extended periods of time during which the battery is kept at 100%.