Ok, this may be a more technical response than you'd:
In any electrical circuit we have a characteristic known as impedance. In a DC circuit the impedance is the resistance of the cable, the resistance to the flow of electricity. In any circuit other than DC, in other words, where the current flow alternates, whether a power circuit, audio, radio frequency circuit, 2 other characteristics come into play, capacitance and inductance. Both of these characteristics, unlike resistance, are frequency dependent and create a characteristic know as reactance. In these non DC circuits, impedance is the combination of resistance and reactance.
To get good fidelity of an audio signal from your guitar into an amplifier, mixer, or anything else, you want the output impedance of the guitar to match the input impedance of the device it is feeding, in your case, your mixer. The problem is that guitar inductive pickups have a typical output impedance around 1,000,000 ohms and piezo pickups are as high as 10,000,000 - 20,000,000 million ohms while line inputs are generally in the 10,000 - 50,000 ohm range and unbalanced microphone inputs run in the 1,000 - 3,000 ohms range. So, you can see that there is a large mismatch between a guitar and a line input and an even larger one feeding a mic input.
As Rockum responded, for short runs (6 - 15 feet), you may not notice the difference at all. But as the runs get longer, the capacitive effects of the cable will usually bleed off the highs making the sound duller as the high frequencies are lost (actually, shorted out through the growing capacitance). A proper DI will have a high input impedance for the instrument, usually in the 1,000,000 - 2,000,000 range and it better "couples" the signal from the guitar into the DI box. The output of the DI box is usually designed to interface with a line input, and therefore is usually in the aforementioned 10,000 - 50,000 range. The impedance change inside the DI box is usually made using a transformer or an actual active circuit, meaning a powered electronics circuit.
For short runs, you likely can plug a guitar or bass right into a mic input, properly adjust the trim and record straight in. As the run gets longer, you won't be able to ignore the high frequency loss. And that loss doesn't come just from the impedance mismatch, you'll also experience a signal loss and higher noise levels because the high impedance across the length of the cable is attenuating the signal and allowing more noise to accumulate.
Some DI boxes have a balanced mic output and that will usually provide a low 300 - 600 ohm input impedance. This is ideal for long runs as the low impedance means that you lose little signal and acquire little additional noise. And balanced mic inputs are also in that low range so you get a high fidelity transfer of the guitar (or bass) output to the mixer input. For such balanced runs, the DI box will have XLR connectors and possibly TRS connectors also, though the latter will often be at line input and impedance levels — still better than high impedance, but not as good as low-impedance balanced levels.
NOTE: If you do have a DI with an XLR output and you use itto get any kind of signal into a mixer, make sure that you have phantom power from the mixer TURNED OFF for the channel into which you plug in. Some DIs have DC filtering to keep the phantom power out, but not all, and those that don't could cause problems, especially for the mixer.
Finally, many pre-amps offer one or two DI inputs that affect an impedance match with circuitry. These usually offer excellent matching characteristics with great frequency fidelity, high levels, and low noise.
I hope this helps.