A MIDI sequencer sequences MIDI messages.
For example, when you play a MIDI keyboard, it generates MIDI messages as well as sound. The MIDI messages contain information like which note was hit (say an E above middle C), how "hard" it was hit (the velocity, from 0-127), when it was released, (note off), and so on.
If these messages go into a sequencer ant it's recording, it saves these messages and time-stamps them. Now if you take that recordede MIDI data when you're done and send it back to the keyboard, the original performance will be more-or-less reproduced.
That part of it is powerful enough -- a glorified player piano -- but there are other applications as well, including synchronizing tape decks and video machines, controlling patch changes on effects boxes, even controling lights and such via MIDI Machine Control...
-AlChuck