DI boxes are actually interfaces for high impedance output or line level devices that are needed to be connected to a mixer console or any other mic-level preamp.
It's meant to match the louder incoming levels (aka volume) to that which the mic preamp (on mixer or outboard) can accept without clipping (distorting). And you will want that because distortion on the mixer is nothing pleasant like stompbox distortion.
Most of the time, basses connect directly to mixer through the DI since the bass's sound is best kept as clean as possible to sound tight.
So for example you are at a venue that has no guitar amp and the sound guy requires you to hook your gear up directly to mixer... so the steps are; axe -> efx pedals -> DI -> mixer -> out through PA.
Of course nothing sounds as good as a guitar amp, but sometimes, PA output is better than no amp at all.
Though it's true that most modern mixers have line-in options, DI boxes are very useful if the mixer board is very far away from the stage. DI boxes have the benefit of converting your unbalanced signal to a balanced one, so whatever interference that enters the long mic cable (which the DI will use) will get cancelled out in the mixer.