The battery has certain chemical to hold charges (so when you shut off car and will be able to restart the vehicle). If you slowly drain the battery by leaving lights on while car is not running (interior light, emergency light, external USB charger, headlight...etc), all chemical will become weak and couldn't hold charges anymore and it's time to replace a new one.