Indirect and non-spontaneous: Electrolysis

Normally, a chemical equilibrium will shift to the weak substances (spontaneous reaction).
The other way is also possible: we can force a redox reaction between weak substances to occur and for that we use external forces:
An electric source, like a battery, connected to the electrodes in an electrochemical system.

Than we talk about electrolysis.

Again, of course, there are two electrodes.
At one of them the half reaction takes place of the reductor and at the other, the half reaction of the oxydator.
The external source has a positive and a negative pole.
The negative pole is connected with an electrode, and than?
That negative pole of the source send many electrons to that electrode; this one turns to be negative (cathode).
The positive pole of the source is connected with the other electrode; this one turns to be positive, because it has to lose electrons (anode).
Thes two charged electrodes - if the potential is sufficient - will now function as follows:

The cathode (negative) will try to lose electrons, will look for particles around capable to pick up electrons (those particles must be oxydators)

The anode (positive) will try to catch electrons and will look for particles capable to donate electrons. (those must be reductors)

If there are particles / substances in an electrode compartment that want to donate or catch electrons - and even weak reductors or oxydators are welcome - than this will happen; if at least the external source is strong enough.
If not, if the source is not strong enough, you always can increase the voltage. The weaker the present oxydator or reductor, the higher the needed voltage of the external source.

Those oxydators and reductors can be molecules, atoms or ions.
Att.: complex ions, in particular those with Oxygen, like sulfate, have some difficulty to participate in this kind of electrolysis reaction, because of their activating energy (here OH- is an exeption).
And again: the redox tables show/determine who will act as reductor and who as an oxidator.

During electrolysis, the redox half reactions occur separately and a total reaction is not always interesting of important.
But a total reaction becomes important when calculations are involved: Than a total reaction is absolutely needed.
But to understand well the electrolysis, it is sufficient to know what exactly happens at each electrode.

Electrodes make indirect redox reactions possible. The transfer of the electrons does not occur in direct contact between the reacting particles, but via conducting matter.
In electrolysis, the electrode can be made of inert material (graphite, platina etc) or they participate in the electrolysis process, as, for example, an electrode of Zincum or Copper.
Remind that also the liquids between the electrodes must be conductive (must contain free ions).

The electrolysis explained in another way:
Imagine that the electrodes will force the present particles to electron transfer.
The anode is positive, so has shortage of electrons, wants to capture electrons, is in search of nearby particles that can donate electrons and - if the voltage is enough - will force those particles, that substance to do so.
At the cathode occurs exactly the opposite.

Have a close look at the following scheme:

An 'animation':
Suppose the two electrodes are two persons: The hand of those two persons hold the electric source, and in this contact, the man is filled with electrons where the woman is emptied by the same source.
Both they don't like this situation; they want to change, to act.
The man is now going to act as a cathode and the woman becomes the anode:

The woman feels great shortage of electrons and, because she stands with her feet in the solution, she will try to find and catch there electrons. And yes, she notices there any substance that can donate electrons (a reductor), no matter if that substance is willing to donate. She will force that substance to give her electrons.
This will happen, exactly at the moment such a particle touches the woman.
The man however is bursting of an overdose of electrons, but has no direct contact with the woman. He stands alone with his feet in the solution where any substance can take over some electrons, wether the particles like it or not.
That substance is forced to pick up electrons, so the man finds some satisfaction and rest.
This will happen as soon as the particles touche the feet of the man.

Easy to foresee what will happen when man and woman would meet directly. A serious short-circuiting would be the case.