Bateria has been a fascinating word because it means many things and there are several ways to talk about what we call batteries in English.
If you are talking about a car battery you could call it a batería, but more commonly it is called an acumulador in Mexico. A flashlight battery has the name pila (most of the time).
Bateria also means a set of drums or a set of pots for cooking.
Pila can mean a tub or trough (like a feed trough).
Along the lines of a battery is an electronic capacitor. It can be referred to as a condensador.
I would think these words all have other meanings. This does not get into the uses of battery in “assault and battery,” nor in any military sense.