When the copper wire is inserted in a piece of potato, the electrons from the negative terminal of the battery start moving towards the positive terminal. It undergoes electrolysis. The process of electrolysis take place because of the starch present in the potato. As a result of this process, more electrons are produced which move from the negative terminal towards the positive terminal. These electrons react with the copper wire which is inserted inside the potato on reaching the positive terminal and hence create a color of the potato becomes greenish due to the reaction.