On direction of electric field in a battery

I know that the electric field points from positive to negative potential in a circuit but it is opposite inside a battery for the purpose of continuity of electron flow and electric field....but why is it so?? I mean on a chemical level of the cell why is the field generated opposite? What reaction is behind it ?

Just to make the description easier let us suppose that the only mobile charges are positive and the battery is not connected to an external circuit.

Within the battery which has two terminals $$A$$ and $$B$$ an electro chemical reaction is occurring which moves positive charges from terminal $$A$$ to terminal $$B$$.
This means that terminal $$B$$ gains a net positive charge and terminal $$A$$ gains a net negative charge.
This in turn means that within the battery an electric field is set up which has a direction from the positive terminal $$B$$ to the negative terminal $$A$$.

As more positive charges migrate from the negative terminal $$A$$ to the positive terminal $$B$$ due to the electrochemical reaction the strength of the electric field within the battery increases, and as this electric field is opposing the migration of the positive charges from the negative terminal to the positive terminal the rate of charge migration decreases.
The migration of electric charges eventually stops when the forces produced by the electrochemical reaction are balanced by the forces due to the electric field within the battery.
When this occurs the potential difference across the terminals of the battery is constant and there is no further migration of positive charges within the battery.

The consequences is that the electric field within a battery is directed from the positive terminal to the negative terminal.

Connecting the battery to a complete external circuit will have the result that positive charges will move from the positive terminal of the battery along the external circuit and finish up at the negative terminal of the battery where they will migrate within the battery from the negative terminal to the positive terminal under the influence of the electrochemical reaction in order that the potential difference across the battery is maintained.

• What force exactly pushes the positive charges from the terminal A to B?...I know the difference between SRPs is the reason but what would we call the force exactly and how would we write its magnitude down? – Schwarz Kugelblitz Aug 12 at 10:13
• And on connecting the battery to the external circuit how would the charges move?.…won't the field which stops the movement within the cell also be present in the wires as soon as it is connected to the cell and subsequently stop the movement as well?? – Schwarz Kugelblitz Aug 12 at 10:15
• @SchwarzKugelblitz As soon as positive charges start moving from the positive terminal and positive charges start arriving at the negative terminal the electric field within the battery decreases and the electrochemical process start to move positive charges with the battery from the negative terminal to the positive terminal to maintain a constant potential difference across the terminals of the battery. – Farcher Aug 12 at 10:32
• I'm afraid that did not answer either of my questions – Schwarz Kugelblitz Aug 12 at 11:09
• you said that charges will move from the negative to positive terminal to maintain potential difference,can u please elaborate on this? Won't the charges be stopped because of the pre existing electric field in the battery like they were initially? – Schwarz Kugelblitz Sep 18 at 19:20