A battery is an electrical device that supplies or maintains a constant potential difference in a circuit. The battery converts the chemical energy stored inside it into electrical energy. It is also called an electromotive force. Such a battery is called a DC (direct current) battery - the current flows in one direction only, when the battery is driving the circuit.
A battery has two electrical terminals, one is called positive terminal and the other, the negative terminal. The positive terminal is at a higher potential. The current in the circuit flows from positive terminal towards negative terminal. Electrons move from negative terminal towards the positive.
Inside the battery, the terminals are attached to metallic plates on which positive or negative ions accumulate. That gives rise to the potential. A battery has a life time. When all the positive charges on the cathode plate move to the anode plate, the battery is discharged. It cannot supply any more voltage. There is an electrolyte between the anode and cathode that facilitates movement of ions (charges).
A battery can be a primary cell or secondary. Primary cells cannot be recharged. The chemical reaction inside the battery cannot be reversed. In secondary cells, the chemical reaction is reversible and so the battery can be recharged using another energy source, a few hundreds or thousands of times.
A battery is sealed in a highly electrically insulating packing material to prevent leakage.
See the diagram for a typical DC circuit with a battery.