When you cycle, you often times go into a high gear to exert less power.
Then, when the hills come, you drop a gear to reduce resistance.
For each person, when they go up/down a gear, the level of resistance and when they change a gear is different.
But regardless, they do it for the same reason – to maintain momentum.