Static builds up like the the charge on a capacitor until the voltage breaks down the air "dielectric" and discharges the capacitor.
When the earth acts like one of the capacitor plates, the discharge voltage gradients cause currents around the discharge point.
An electrode acts a bit like an air terminal and eases the current flow into the earth, so its main purpose is to reduce impedance.