There are many reasons for which you might need your iPhone battery to be replaced and some of them are mentioned here as well. But there are two scenarios, the first one being that the iPhone is under the warranty, that is that the iPhone’s battery is not working fine just after it was bought or at least in the time period where it had the apple care+ warranty, which means that if there is any problem in the phone set the apple company would get the battery repaired free of cost. But in the case when the warranty has expired then you can get the apple company to replace the battery but they will not do that for you free of cost rather they would ask you to pay them at least 49$ as per the website that the apple company has. That is a lot of money and many people can really not afford to have all that maintenance charges after they have invested this much in the phone itself and so many companies have started replacing the iPhone batteries properly and that too for a very less amount compared to what is asked by the apple company.
If your phone is switched off without any warning that is if your battery is full or at least 50% and up and still the phone gets turned off for no reason, that you can see. This means that you need to have your battery replaced as soon as possible because it is the battery of the iPhone that is causing all this problem in the first place and it is a good idea to get it replaced in the first place because a bad battery can cause a lot of negative impact on the phone and its health over all as well and you obviously would not want that for you to happen. In other words, if your phone dies in the middle of the day and this has started to happen quite often that means that you need to have the battery replaced as soon as you can for that matter then.
There are two ways to have the battery replaced by the apple company, either you wait and they send you a package that is a box in which you would send bask your phone to be replaced or you can make an appointment on the apple store and bring the phone for the replacement of the battery. But quite honestly the apple store takes a huge amount of money considering only the battery has to be replaced and so many people all around the world have been switching to other local companies and businesses that offer the replacement of the battery of apple products as well.