People assume a dead battery means they left something on. Sometimes it does. More often the battery has been losing ground for months and the light was just the last straw.
The obvious one: something left on
Headlights, an interior lamp, a boot light stuck on, a phone charger in a socket that stays live. This is the easiest case, because the battery is usually fine underneath. A jump and a decent drive, or a proper charge, and you are back to normal.
Short trips that never recharge it
Starting the engine is the single biggest current draw the battery ever sees. Putting that back takes more than the eight minutes it takes you to get to the station. Do that every day for a year and the battery lives permanently at partial charge, which is exactly the state that ruins it.
This is the most common cause we see in commuter towns, and it is invisible until the car will not start.
A parasitic drain
Modern cars never fully sleep. Alarms, telematics, keyless entry receivers, and infotainment all draw a small current with the key out, and that is normal and accounted for. What is not normal is a module that fails to go to sleep, or an aftermarket accessory wired badly. That kind of drain empties a healthy battery overnight.
The tell is a car that goes flat repeatedly, especially after sitting a day or two, with a battery that keeps testing fine.
Corroded or loose terminals
The white or pale blue crust around a terminal is not cosmetic. It is resistance, and resistance in the highest current connection on the vehicle causes real problems. A battery in good health can crank weakly or not at all purely because the connection is bad. Cleaning the terminals back to bare metal fixes more no start calls than people expect.
A charging system that stopped keeping up
If the alternator is not producing what it should, the battery gets emptied a little more on every trip and never gets it back. Replace the battery and the new one dies too, usually within days, which is how people end up buying two batteries for one alternator fault.
Heat, cold, and age
Under all of the above sits ordinary wear. Heat degrades the plates, cold reduces the current the battery can deliver while simultaneously demanding more of it, and every cycle takes a little capacity away.
Which of these is happening to your car is a question a load test and a charging check answer in a few minutes. Guessing is how people replace the wrong part.