How do electrochemical cells relate to electrolysis?
Electrochemical cells convert chemical energy to electrical, producing an electric current with a potential.
For example, a copper/silver electrochemical cell produces a positive cell potential.
The electrical current flowing in the external circuit can do work. Copper goes into solution as Cu²⁺ ions, and Ag⁺ ions plate out as metallic silver.
Electrolysis converts electrical energy to chemical, requiring an electric current.
If you use a battery to reverse the current flow, the silver goes into solution as Ag⁺ ions, and the Cu²⁺ ions plate out as copper metal.