There are many reasons why a laptop/MacBook or tablet won't keep charge, but a complete loss of power is not the worst-case scenario. There is a chance that your laptop/MacBook/tablet isn't keeping charge because of a serious issue, but it's unlikely. In most cases the Battery may just require replacing.
Faulty/old batteries can cause laptops/MacBooks & tablets not to keep charge. Even if it appears that your laptop/MacBook/tablet is receiving power, lights are on, fans are running or even if it powers on for just a moment this can be caused by a faulty battery.