Electrolysis and Faraday's law
An outside power supply can drive an unfavorable redox reaction in an electrolytic cell, and since each mole of electrons carries $96\,485$ coulombs, the current and time fix how much metal is plated or gas released.
From General Chemistry.