Its advisable to change batteries if your device is over 2 years old, or your battery health indicator is below 80%
apple claims that the iPhone & iPad's battery will be good for 400 to 500 recharge cycles and should last for a couple of years. But it might last for a shorter time if it's used heavily.
The Same rule applies to Samsung, Huawei and all other major smartphone manufacturers as the batteries are very similar in design and capacity
Old batteries can eventually expand and cause other issues like cracked screens due to the expansion