Graphite electrodes can conduct electricity and are very stable in nature, do not chemically react with the medium, and will not change due to electrolysis. Platinum and gold also meet this requirement, but they are expensive, so graphite is chosen as the electrode.
The main reason for using graphite electrodes in electrolysis is that graphite is an excellent conductor. The structure of graphite allows a large number of electrons to float freely between different layers of atoms (graphite bonds are formed by only three of the four electron shells of carbon atoms, while the fourth electron is free to move). These electrons act as powerful conductors, enabling the electrolysis process to proceed smoothly. In addition, graphite is economical, stable and wear-resistant at high temperatures. For all these reasons, graphite electrodes are often used in electrolysis.