Lithium-ion batteries degrade through charge cycles, not just time, which means charging habits directly affect how much capacity an iPhone retains after two or three years.
Keeping the battery between roughly 20 and 80 percent for daily use, avoiding extreme heat, and using Optimized Battery Charging all reduce long-term wear.
The Battery Health setting in iOS reports maximum capacity directly, making it easy to track degradation and decide when a battery replacement is worthwhile.