iPhone turning off on low battery My iPhone SE on iOS 12 has been acting strange recently. 

Yesterday, it turned off at around 10% and when I tried to turn it on it said that it has no power. Two minutes later, it turned on and said it had 14% capacity remaining.

Today, when it was at around 10%, it turned off. Then I turned it on  and it said 12%. Two minutes later, it turned off. It says "connect to power."

After a few minutes I tried again and it turned on. Then it gives an error saying  that it "can’t connect to my mobile data network" and then the  phone crashes. 

I turned it on again, and it worked normally. 

What is causing this?

EDIT: After digging around my batter settings I found this:
Your battery is failing/has failed.

The symptoms that your iPhone is exhibiting is the same as what discussed in the following posts:


Mid 2012 MBP shuts down claiming no power with charge at 30% or 40% or more 
Why is my MacBook Pro showing the low battery screen while at 100%?
Fully charged MacBook Air turns off when power cord removed


Basically, when you see a percentage of battery remaining, it's a calculation based on what it's measuring (volts, amps, draw, etc.) at that moment in time.  You cannot measure remaining capacity - this  especially noticeable if one of the in-line cells is faulty. 

The only solution to this problem is to replace the battery.