A battery is a military term for a unit of guns, mortars, or rockets grouped to facilitate better battlefield command and communication.
Its use in baseball to describe a pitcher and a catcher alludes to the fact that the battery is the principle attack force for the small army of nine players on a baseball diamond.
There is also an earlier theory that the baseball term derives from telegraphy where the word battery, also borrowed from artillery, defines the sender (pitcher) and the receiver (catcher).