the right time in order to finish charing to 100 when you need it. That way it doesn't degrade the battery as much by having the phone sitting at 100% all night.
And it is flexible because it can both learn your schedule and use what alarms you have set to make sure it's done. Apple's just guesses based on usage and gets it wrong sometimes.