A direct box takes your guitar's quarter-inch line connection and outputs a balanced signal, generally via XLR cable--a three-pronged cable used for professional audio applications, with positive, negative and ground wires. The XLR cable is then connected to a microphone-type connection on a mixing desk for further processing. Some direct boxes will have volume, power and gain controls.
An acoustic guitar's output is considered a high-impedance signal. This means there is a high level of electrical resistance to the flow of current running down the cable. As such, the acoustic guitar's cable will act as an antenna, picking up unwanted interference along the way. The longer the cable is, the greater the interference. A direct box lowers the impedance of the signal, grounds the cable and eliminates or minimizes this unwanted interference.
There are two types of direct box: active and passive. A passive box is usually cheaper, requires no power source and offers fewer features. It simply takes the unbalanced signal from your guitar and outputs it to a balanced line. The advantage of using a passive box is that it is simple to use and reliable.
An active box requires external power--either by battery or AC adapter--and can provide volume control to the signal as well as signal balancing. An active box may also provide features such as multiple outputs or stereo output.
A direct box allows you to use a longer instrument cable. Without it, the acoustic guitar's signal is susceptible to unwanted noise or distortion. This is useful in live performances especially. It is also useful during recording, when a clear and controllable signal is desired.
The ability for the signal to be controlled at a mixing desk is also useful in both live and recording environments, where changes such as volume leveling or effects processing can be made during play by a sound engineer or other operator.
A direct box can also be used with any unbalanced, high-impedance instrument. This includes keyboards, amplifiers with an output line and electric guitars.