Inside the battery chemical reactions are going on. Both the anode and the cathode react with the electrolyte, which separates the two. In the chemical reaction between the anode and the electrolyte electrons are created, and they will accumulate at the anode.
Since electrons naturally repel each other they will look for a way to escape to an environment with less electrons, and luckily the chemical reaction between the cathode and the electrolyte enables the cathode to accept electrons.
However, the only way for the electrons to travel from the anode to the cathode is if we create a path between the two. This could be by connecting the positive and the negative ends of the battery with a wire. In this circuit we can add a device, like a lightbulb, and the flow of electrons from the anode to the cathode will power the lightbulb. This is actually how a very, very basic flashlight works.
As the battery is being used the chemistry inside the battery changes and the resistance becomes greater until the flow of electrons completely stops. This is how a battery runs out of power.