MIDI stands for Musical Instrument Digital Interface. (My friend Steve thinks it stands for "Marketing Instruments to Dumb Individuals.") MIDI is a specification developed in the 1980s that established a protocol for electronic musical instruments to communicate with each other and with computers. Now, when you play a keyboard, you not only generate an analog audio signal (a.k.a. "music") through standard analog outputs, you also generate performance data (through the MIDI port) such as which note was played, the velocity with which the key was struck, etc. A typical application is to connect the MIDI output of one keyboard to the MIDI input of another keyboard; playing a note on the first keyboard will also cause the note to sound on the second keyboard. A popular use of this feature is the piano/string layer.
MIDI keyboard performance data can also be recorded by a computer and used to play the instrument, much like the electronic equivalent of a player piano - this is called sequencing. Sequenced data is extremely economical in terms of memory consumption, can be edited very easily, and is endlessly flexible: The speed of a MIDI sequenced song can be altered without affecting pitch, and vice versa. And, if you are so inclined, you can change the tempo AND pitch of a sequence. Sound assignments, levels and pan positions can be changed right up until the final mix. Just remember that MIDI is data, not sound.
what is MIDI/what is sequencing?