Click on this link about 'iPhone Battery and Performance' to read about the battery health feature and what is considered normal performance --> https://support.apple.com/HT208387
Realize that some degradation is expected with time, depending upon use. When you see a message recommending battery replacement, take it to Apple. They will decide if it is eligible for free replacement.
The link below takes you to a document about 'iPhone Battery & Power Repair' outlining battery replacement, cost, and time to repair.
Click here --> https://support.apple.com/iphone/repair/battery-power