2 wheels force is put on the back gear to push a larger gear on front . when pedalling on flat force should be applied on middle to smaller size. However when bike reached a terminal force it rider will move to smaller gear and go faster. If bike is going down hill the force of gravity will mean rider can manage the smallest gear as in fastest speed as Force = Mass × Velocity and the impact of gravity means less force is required as the weight of the bike and rider However the opposite it through for uphill as the rider is going against gravity ..weight and gravity will mean the rider will need to go to the larger gear the slower speed.
There are other factors as in wind and slip stream and type of pedals to maximise the force.