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

When the charge level of the battery gets too low, your computer will automatically hibernate. 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.

You can change what happens when the battery level gets too low by opening Power from the Activities overview. Look at the When power is critically low setting. You can choose for the computer to hibernate or shut down. If you choose shut down, your applications and documents will not be saved before the computer turns off.

Some computers have problems hibernating, and may not be able to recover the applications and documents you had open when you turn on the computer again. In this case, it is possible that you could lose some of your work if you did not save it before the computer hibernated. You may be able to fix problems with hibernation though.