Musical Instruments Digital Interface or MIDI is a time based protocol for data transfer that allows data exchange and controls the synchronicity among electronic musical instruments like synthesizers. MIDI is applicable to a lot of sound cards.
MIDI transfers musical data (notes and melodies) while music is being played or recorded. Contrary to popular belief, MIDI files are very small and do not create sounds or melodies of a music track, they only transfer information about the position of notes (time), velocity, pitch, speed, etc.
The information is then being managed by sound cards or instruments to play music via Wavetables or SoundFonts. The sound of a MIDI file is therefore determined by the quality and sound generation of the according player. In the past, MIDI files were used as background music for websites, but as bandwidths are getting faster, they are increasingly replaced by high quality MP3 files.