Your iPhone needs to learn your charging habits first:
...
With iPhone 15 models and later, if the charge limit is 100 percent, you can also turn on Optimized Battery Charging. Your iPhone has these settings by default.
Your iPhone will charge to within a few percentage points of your chosen limit and then stop charging. If the battery charge level drops more than 5 percent while connected to power, charging will resume, again charging to within a few points of your chosen limit.
If iOS determines that a charge limit will help preserve your battery's lifespan, you'll see a recommendation. For example, you might see "Based on your iPhone habits, a charge limit of 95% is recommended to help preserve your battery."
If you have Charge Limit set to less than 100 percent, your iPhone will occasionally charge to 100 percent to maintain accurate battery state-of-charge estimates.
...
copied from: About Charge Limit and Optimized Battery Charging on iPhone - Apple Support