Midi is just data that triggers certain parameters (like note-on, note-off, velocity, panning, etc.). Usually, you use midi to record the data that triggers sounds in a program (like Cubase, Reason, Fruity Loops) and at that stage you'd export it as either compressed (mp3) or uncompressed (wav).

It's actually quite interesting and amazing the amount of libraries you can use with midi, that will generate real-sounding instruments (and I don't mean from only triggering samples either).