In electrochemical doping, an external voltage is applied to a material submerged in an electrolyte solution. This causes either the injection of electrons (n-type doping) or the removal of electrons (p-type doping) from the material. The process can be visualized as a series of redox (reduction-oxidation) reactions where compounds in the electrolyte gain or lose electrons, altering the electronic properties of the nanomaterial.