Step-by-step explanation:
Electrical energy is the energy produced due to flow of electrons.
Whereas a reaction in which oxidation and reduction reaction takes place is known as a redox reaction. Basically, there is exchange of electrons that take place in a redox reaction.
For example,

Oxidation half reaction:

Reduction half reaction:

Hence, this flow of electrons acts as a source of electrical energy.