Ideally, you want to reduce the time period your iPhone spends fully charged at 100%, in order to increase its battery's lifespan.
Note: Several factors actually contribute to the lifespan; charging cycle (pattern) is one of them.
So, you could charge it to a 100% but you don't want to keep it charged at 100% for a longer time/extended time after it reaches that 100%. Similarly, you don't want to keep it fully discharged or at lower than 20% for extended time periods.
Practically, (previously) it was/is not possible/feasible to control that time period, so it had/has been suggested to keep one's Li-ion battery charged at 80%.
Enter iOS 13, Apple introduces Optimized Battery Charging, to improve your battery's lifespan by reducing the time your iPhone spends fully charged. So, if the setting is turned ON, the algorithm studies your charging pattern - when do you normally charge your iPhone and for how long, in which locations, etc. If it detects a routine without too many variables, then it activates. for eg. you mostly charge your iPhone overnight at home, and stop it from charging at 7 am when you usually wake up., Optimized Battery Charging will activate to charge your iPhone to 80% as quickly as possible as it normally would (depending on the charging adapter you use), but the remaining 20% would be charged in a delayed fashion aiming to reach a 100% just prior to 7 am. This way your iPhone would not stay charged at 100% for a longer time than necessary.