A battery is a device that converts chemical energy into electrical energy, and it does that by using electrodes and solutions. Usually, we will have two electrodes connected by an external circuit, usually, a wire, and the flow of electrons from one solution to another will be converted to electrical energy, which is basically the definition of electricity, the flow of electrons.
In this picture we can see the solutions of Zinc (s) and Copper (s), the Zinc will lose electrons and these electrons will flow through an external circuit, a wire, and reach the Copper, which will receive the electrons.