It smooths the 6V battery voltage from jumping up and down when the LEDs turn on and turn off when the battery voltage is running down because its internal resistance is increasing. The transistors might not sequence properly when their supply voltage is jumping up and down.
All electronic circuits work better when they have a supply bypass capacitor like this.