Apple CEO Tim Cook speaks during Apple’s annual Worldwide Developers Conference in San Jose, California, June 3, 2019.Mason Trinca | ReutersApple’s new iPhone software, iOS 13, includes a new feature that will help your battery last longer before it needs to be replaced.This is important.People are holding on to their phones longer these days, often for three or four years, instead of upgrading every two years or so as was common when smartphones were new and improved more dramatically with every release. But when you hold on to a phone for that long, batteries start to lose their ability to hold a charge as effectively, which means that your battery life starts to get worse.Apple launched a battery replacement program in 2018 after it was criticized for slowing down older iPhones to maintain performance. Since then, it added an option that allows users to see if their battery is running at maximum capacity. If it isn’t, users can take in their phone to get the battery replaced by Apple. iOS 13 builds on this even further with a built-in feature to help your battery last longer in the first place.The new Optimized Battery Charging feature in iOS 13.Todd Haselton | CNBCThe new feature, called « optimized battery charging, » will launch for iPhones this fall in the iOS 13 update but is already available for developer testing ahead of a public preview launch next month. I found it on my iPhone under battery settings, which is running the developer preview of iOS 13. It was turned on by default, which means you may not even need to turn it on when the software is available this fall.Apple’s iOS 13 website explains what it does: « A new option helps slow the rate of battery aging by reducing the time your iPhone spends fully charged. iPhone uses on-device machine learning to understand your daily charging routine so it can wait to finish charging past 80% until you need to use it. »Apple’s battery website explains that the lithium ion batteries inside of an iPhone can quickly charge up to 80 percent. The remaining 20 percent uses a « trickle charge » that « eases the electrical current to extend battery lifespan. » But, when your phone is plugged in, this trickle charge continues to run in an effort to keep the battery fully charged. That can wear your battery out more quickly.Apple’s new feature will prevent the phone from charging up to 100 percent, and activating the trickle charge, until it thinks you’re going to need it. So, if you typically pull your iPhone off the charger at 6 a.m., it’ll finish juicing up the last 20 percent just before then, instead of earlier in the night when it might consistently try to keep the iPhone charged at 100 percent.Doing this is supposed to reduce battery aging and allow you to use your iPhone at peak performance and with a maximum battery capacity for longer. In short, it’s good news for people who want to own their phone for several years without having to replace their batteries.