John Matson, A Bicycle Built for None: What Makes a Riderless Bike Stable?, Scientific American, April 14, 2011:
Once rolling, bicycles can cover ground just fine on their own—no rider required—thanks to a property known as self-stability. If a bicycle starts to tip over, its front wheel turns into the fall, bringing the bike back into balance, just as a rider would do if he or she were behind the handlebars. Of course, that stability is missing when the bicycle is stationary—bicycles have a limited range of self-stable velocities within which they are able to regain their balance even if knocked sideways.
The question of how bicycles work—and what causes self-stability—has been around since the 19th century. Over the years, two main factors have emerged to explain a riderless bicycle's balancing act. One is the gyroscopic motion of the spinning front wheel; the other, a design feature known as trail, is the placement of the bicycle's steering axis so that the axis intersects the ground ahead of the point where the front wheel meets the ground. Both features act to couple the bicycle's steering to its leaning—if the bicycle tips rightward, it will steer to the right—allowing it to turn into a fall and remain upright.