The potentiostat maintains a constant potential at the working electrode by adjusting the current flow through the counter electrode. It consists of three main components: the working electrode, the reference electrode, and the counter electrode. The working electrode is where the reaction of interest occurs, the reference electrode maintains a stable potential, and the counter electrode helps to balance the current.