Is there technology that keeps a phone or laptop battery from overcharging, and how does it work?
Yes. Every laptop and smartphone has charging circuitry that stops the battery from overcharging. An iPhone fast charges to 80%, then trickle charges toward 100%, and then cycles charging on and off to hold the battery just under full. Since iOS 13, Optimized Battery Charging also holds the phone at 80% and learns when you usually unplug it, so it can finish the last 20% just in time.