Why did my computer turn off when the battery got to 10%?

When the charge level of the battery gets too low, your computer will automatically turn off. It does this to make sure that the battery does not completely discharge, since this is bad for the battery. If the battery just ran out, the computer would not have time to shut down properly either.

Bear in mind that when your computer automatically turns off, your applications and documents are not saved. To avoid losing your work, save it before the battery gets too low.