Note On / Note Off
MIDI's two basic messages: a key went down, a key came up — and all the trouble that follows when the second one never arrives.
Note On has status byte 9n, where n is the MIDI channel, followed by a note number 0–127 and a velocity. Note Off is 8n with a note number and release velocity, a value almost no keyboard measures and almost no synth uses. The spec also allows Note On with velocity 0 to mean Note Off. It looks like a quirk but it is an optimisation: an entire melody can then share one status byte and take advantage of running status.
The protocol keeps no state beyond this. Lose a Note Off — a cable pulled, a program crashing mid-note — and the note drones on until somebody intervenes. Hence the All Notes Off controller message, and the panic button in every DAW that sends Note Off to all 128 notes on all 16 channels, just to be sure.