Defined in 1982, MIDI is a standard protocol that allows multiple electronic instruments and musical devices to communicate and synchronize with themselves.
A composition saved as midi is a sequence of notes and commands that will be played back by the computer's own midi drivers. Since this makes a midi file much smaller than an audio file, midi files have a rich history of use in computer games, software, web, ect...