When you think about it, battery can have a lot of different meanings. The most common way we use it is to refer to the cells that power so many devices like our phones.
But it can also be used to refer to physical beating (e.g. assault and battery) or a military attack like a bombardment. You can see how both of those uses share a sense of violence, specifically striking, so how is it that also use the word battery to refer to the little thing in our phones?
The original meaning of the word, dating back to the 1530s, is physical assault, coming via Middle French from the Latin battuere (to beat). This word is also the origin of course of the verb to beat, but also the noun batter, because if you want to make some batter for some pancakes, for example, you’re going to need to beat some eggs.
The use of battery to refer to a military assault is a fairly logical extension of this use, and it’s believed that our use of battery to refer to an electrical cell comes in turn from this military meaning. It seems like Benjamin Franklin was the first to use in 1748, and he likened the discharge of electricity in a battery to the discharge of weapons in a military battery.
Seeing the steps involved, it seems like a fairly logical chain of meaning. Using to fire as a verb by the way, as in to discharge someone from their job, is also probably derived from the sense of discharging a weapon, known as firing because of the sparks produced. Of course we don’t associate phone batteries with fire, unless you were the unlucky owner of a Samsung Galaxy Note 7.