Laptop batteries contain a capacity gauge that allows us to know the exact amount of energy stored. However, due to the charging/discharging cycles, this sensor tends to be inaccurate overtime.
Some laptops include in their BIOS, tools to recalibrate this battery gauge, which is nothing more than a full discharge followed by a full charge.
So to calibrate the gauge, it should be performed, in every 30 discharge cycles, a full discharge non-stop , followed by a also, non-stop, full charge.
An inaccurate gauge can lead to the fact that the the battery capacity values are are wrong. The battery may report that it still has 10% of capacity when in fact it has a much lower value, and this causes the computer to shutdown unexpectedly.