iPhone restarting when battery below X%
Certain iPhone 6S models were known to have this problem.  You can check the serial number at this site to see if it's affected (presuming it's a 6s; you didn't specify the model):

https://www.apple.com/support/iphone6s-unexpectedshutdown/

Mine had this problem, and the guys at the Apple Store repaired it (I don't know if it was the battery or a component on the logic board).

For other devices, you may have to try erasing all content and setting it up as a new device and give that a try for a few days to see if that fixes it.  I want to say that my brother had the same symptom and a reset was the solution for him (it's been a while).

I've had an occasional problem with restoring years of accumulated backups and phone migrations that only a fresh install seems to fix.