A direct box takes an unbalanced signal from a guitar, bass, or other unbalanced source and converts it into a balanced audio signal. In other words, an unbalanced guitar cord comes in, but balanced XLR (mic-style) cable comes out. To get the most from a direct box, your mixing board must have balanced mic and/or line inputs! (Note that some mixers offer both XLR and 1/4" balanced inputs -- check your manual.)
"Balanced" audio connections and cabling combat this problem. The output of a professional, balanced microphone can run hundreds of feet and stay clean, while an unbalanced mic could be unusable after just a 20- or 30-foot run.
A bass, acoustic guitar, or synth typically has an "unbalanced" output--either a weak "instrument-level" or somewhat hotter "line-level" signal. Unbalanced signals--especially low-level ones--are susceptible to picking up buzz, hum, or radio frequency interference. The lower the signal level of the source (i.e., your guitar), the more you'll need to boost your instrument at the mixer. Unfortunately, the noise gets boosted along with the source; the longer the cable, the worse the problem.
FYI, a balanced cable uses three wires (hot, cold, and ground), and the connections are usually either XLR (like the typical mic chord) or 1/4" or bantam-sized Tip/Ring/Sleeve (TRS) connectors. Unbalanced connections use two wires (hot and ground), like your guitar cord or the typical RCA connector. Balanced cables pick up the same interference, but the noises get cancelled out at the mixer's input.
Use a direct box if you are experiencing hum, buzz, or radio interference, or if your instrument's cable is longer than 20 feet. Keep the cord from your instrument to the direct box as short as you can and make up the rest of the run with a balanced XLR cable. Some DIs offer ground-lift switches, which can break ground loops, another source of hum. Finally, many pro-oriented DIs require power, supplied either by phantom power from the mixer or an internal 9V battery.