It's the same as a manual transmission in a car, and the rate you're peddling is like the RPM of the car's engine. Once you spin too fast you need to shift to a higher gear ratio in order to ride efficiently, whereas if you're going up a hill, your legs won't be able to spin fast enough if the gear is too high (not enough torque, like starting off on a hill in downtown seattle in 4th gear) so you need to downshift.
If you've never driven a manual this won't help at all. LOL!