What becomes of the electric energy provided in electrolysis? In what device is this energy transformation reversed?

It becomes chemical potential energy. In a battery.