reference electrode
Imagine trying to measure how tall a wave is. You cannot say 'this high' without something steady to measure against — a fixed mark on a pier. A reference electrode is exactly that fixed mark for voltage: an electrode built to hold one constant, known potential no matter what the sample is doing, so that any change you see in the meter must be coming from the other electrode, not from this one.
Formally, a reference electrode is a half-cell with a stable, reproducible, well-defined potential that is essentially independent of the composition of the sample solution. Common designs are the saturated calomel electrode and the silver–silver chloride electrode, both built around a metal in contact with a saturated salt solution. In a potentiometric measurement it provides the steady baseline against which the indicator electrode's variable potential is read.
It matters because the whole measurement is a difference of two potentials: if the reference drifts, you blame the sample for changes that were really the reference's fault. The caveat is that reference electrodes are not maintenance-free — their internal filling solution can dry out, get contaminated, or develop a clogged junction, and a sick reference is one of the most common hidden causes of bad potentiometric and pH readings.
Inside a common pH probe, the silver–silver chloride reference sits in a tube of saturated potassium chloride and connects to the sample through a tiny porous plug. As long as that plug stays open and the chloride stays saturated, the reference holds its potential and only the glass membrane's response varies.
The reference holds a fixed potential so changes are blamed only on the indicator.
The reference electrode connects to the sample through a liquid junction, which itself contributes a small extra liquid junction potential — usually small and roughly constant, but worth remembering when high accuracy is needed.