Again -and let me know if this contradicts what I said before
-,
pila is the unit -be it a cell, a voltaic pile or a matrix of cells-
batería is the arrange of
pilas created to achieve certain voltage with some technical purpose. I doesn't relate to the stacking of elements or lack thereof, it relates to the chronological evolution of Spanish. DRAE -as conservative and tardy (and ignorant) as it is in technological matters- had these words in the following editions:
1869 --->
pila. Fis. Aparato que sirve para desenvolver la electricidad, mediante el contacto de cuerpos de distinta naturaleza, como la de
Volta y otras más modernas.
1884 --->
batería eléctrica. Fis. Reunión de varias pilas, que, comunicándose entre sí, producen grande acumulación de electricidad.
So, Bob, asking a
batería for a hearing aid sounds overkilling and very uncomfortable, what should be a warning about false friends and false cognates in our languages, because it causes funny situations, like being thrown out and banned from a
librería because you went to read a whole book there.