Battery derived its energy from the chemical reaction of the chemical substances in it. When the battery is not used, the chemical reaction still takes place but at a much much slower rate.
After a long time, when the chemical substances in the battery have all been reacted, the battery then will lose all its [electricity].