Obviously for such a diversity of uses, a variety of battery types are necessary. But all of them work from the same basic principles. The first battery was demonstrated nearly 200 years ago and batteries have been extensively researched since then. Even so, there is much yet to be learned about the details of battery chemistry. New battery types and significant improvements in the performance of existing batteries have spurred the increased use of batteries throughout society.
Batteries can be frustrating.
We have all had experiences where we went to use a battery-powered flashlight or appliance and it hasn't worked. Or we have gone to start the car and nothing happened. Much of the time it isn't the battery's fault. We left the flashlight on or forgot to recharge the appliance or left the headlights on. But the battery gets the blame anyway.