But it might also be because of an unwanted app that drains your battery,
These are some of the steps you can try out.
1) Uninstall unwanted apps,
2) Update your phone to the latest software update
3) Run a scan,
4) In iPhone, you have an option to check the battery health if you have your phone backed up,
5) Try resetting to factory setting,
6) If the problem persists take the phone to a mobile doctor.