The cerebellum has one of the largest nerve cells of the body, the Purkinje cells, in addition to other types of cells. Purkinje cells have numerous tree-like branching dendritic processes. They receive two types of electrical connections; from the mossy fibers (about 250000 to 1 million fibers for each Purkinje cell) and climbing fibers (ONLY one for each cell).
The cerebellum fine tunes the movement that accompanies a certain task in the following way. The brain (lateral portions of the cerebellum and the basal ganglia) 'plans the action' even before we start an action. After the task has been executed, the cerebellum calculates the 'error', the difference between the planned trajectory and the achieved output in much the same way a does.
A still better analogy is that of the phase locked loop, the output phase of which 'locks' to the input frequency (diagram on the left). Likewise, the cerebellum too matches its expected action with that of the resulting action. The cerebellum is 'happy' with the performance when the error is minimum. At this moment of bliss, the climbing fibers fire for a long duration and with a characteristic waveform: a spike followed by a long trail. Now the information is written permanently.