Dear student, The chemical energy comes from the ions which get generated due to the presence of the cathode and the anode. The anion and cation move to the respective electrodes which give rise to the chemical energy required for the process. Regards