...vital in trials riding
Balance can be practiced everyday, with simple exercises like trying to stay on the bike stand-still at red traffic lights (that is if you're not colour blind like me), or by turning the bike around between a few marks on the ground. In bike trials competitions, every foot on the ground (dab) is a penalty, so you'd better learn how to keep yours on the bike. Bike categories include 20" wheel bikes (or mod) and 26" wheel bikes (stock bikes)
And there are two main ruling organizations for trials riding, each one with its own set of rules: The UCI rules... and the BIU rules (bashguard and pedal support allowed). The more balance, the easier it is to ride along an edge in one straight line without wobbling the bars. When riding trials, its not necessary to shift gears, and you can set the gear ratio to a nearly 1:1 (from crank to cassette, in fact about 1.2 is good). Typically, the front ring has 22 or 20 teeth (granny ring in normal mountain bikes), and the rear sprocket 18 or 17 teeth (the 6th or 7th easiest speed on a 9 speeds cassette). Good brakes are a must, with large bumpy tires (2.25" or more on the rear) if you want to have a good grip on any surface. Some trials specific cranks have as little as 16 teeth on the chain ring.
not really the best time to put a foot on the ground

Some cool ways to improve your balance.
slashThe first thing you want to know is how to lift the front wheel for a wheeling or to start a few hops on the rear.
slashYou 'll get on the front wheel by shifting your weight above the handlebars, for smooth repositionning of the rear wheel.
slashThen you can try a few hops on the front wheel.
slash Use a combination of the front wheel and back wheel steps to turn the bike around and get ready for your next move.
slashYou can hop sideways in small bounces, either to stay balanced, reposition the bike, or climb up some steps.
slashThe wheeling is an absolute classic for kids. "Braking control" is essential, and one way of learning is to start wheelings up a very smooth slope, by adjusting the pedal pressure.
slashTry out the wheel-swap, usually front-to-backwheel, and finish off your moves in style. Useful in some advanced techniques.

bouncing on the front wheel

balancing to the extreme to avoid a dab.
How to practice balance?
Ride very slowly upwards a very smooth slope, and go slower until the bike actually stops without the brakes. Then try to maintain the bike on the same spot by adjusting the pressure on the driving pedal (your preferred foot forward, right foot most of the time). If you are loosing balance, push on the pedal to carry on or twist the handle bars to get extra balance. The next step to understand balance better is to let the bike go backwards in the same slope, by decreasing the pressure in the pedals. This exercice is easier on a medium gear ratio.
If you fall on the left, turn the bars on the left and shift your body on the right side of the bike (see the pic above). If you fall on the right side (below), turn the bars on the right and shift your body on the left side of the bike. If that's not enough, or if your body is already leaning too much on the right side, then extend your opposite leg on the outside to counter-balance.

A good exercise is to follow some lines
Kenny on a rail.

Good brakes a must