Once an LED turns on it has almost no resistance, so connecting it straight across a battery lets a runaway current flow — and it burns out in a flash. The fix is a series resistor: it sits in line with the LED, soaks up the leftover voltage, and caps the current at a safe level.