A graphic way of understanding what's happening
This flash animation looks in reasonable detail at what happens during the electrolysis of brine - a concentrated aqueous solution of sodium chloride - using inert graphite electrodes
Source: Frankly Chemistry