The energy comes from the metal electrodes not the potato. Potato is just an electrolyte carrying current between the cathode and anode.