Short answer:
So that the cyclist does not slide back down
Long answer:
The main forces a cyclist must conquer are air resistance and gravity. Air resistance increases exponentially with speed. In the switch from cycling on a flat road to hiking a hill, the decreased speed reduces air resistance to the point where drafting other riders offers small benefit. At this point, smaller cyclists, who have finer power-to-weight ratios, will be able to break away from the peloton. Climbing skill can be improved by minimizing weight, and also by pedalling at a constantly elevated rhythm. Large cyclists can attain greater downhill speeds, but on mountainous courses smaller cyclists still have a benefit.