When your car idles, the engine and alternator run slowly. The alternator provides enough electricity to charge the battery. If you use high-powered accessories, the idling alternator can't keep up with electrical demand. The battery makes up the difference, draining it.
When you start you car, all the energy comes from the battery. After it starts, the alternator replaces the energy used for starting. An idling alternator takes longer to charge the battery than a fast-running one.
If the alternator has problems, it puts out either too little charge or none at all. Your car will run off the battery until it uses the battery charge up completely. A borderline alternator may provide enough charge in normal driving but too little during idle. In this case, the car's ignition system and accessories will drain the battery when the engine idles.
High-powered electrical accessories such as car stereos and headlights put additional loads on the alternator. If you run an accessory that uses more current than the idling alternator can put out, it will drain the battery.