on a user level it's actually pretty simple.
although we often use the words "keyboards" and "synthesizers" interchangeably, they are in fact two different things.
the synth is where the noise comes from and the keyboard is what controls or "triggers" the sounds from the synth. so basically the "synth" and the "controller".
sometimes they are together in one unit and sometimes they are separate.
see this beast... [img][379:500]http://www.synthtopia.com/content/wp-content/uploads/2008/06/synthpunk-modular-synthesizer.jpg[/img]
it's a modular synth---that's what some of the first synths looked like. they didn't have a keyboard part... only the sound-generating part. you would set the pitch via dials.
so basically MIDI is a way to control a synth. nowadays most synths have both sound-generating and midi controller capabilities, but the most clear cut way for me to describe it is using old technology.
I have an old synth (it's a *cough* Korg "Poly Six") it's an analog synth. It has no digital components or MIDI, so all it does is generate an audio signal, like a guitar would.
[img][650:237]http://www.zikinf.com/_gfx/matos/dyn/large/korg-polysix.jpg[/img]
So in terms of interfacing with the computer, with the Polysix you'd need a soundcard that would have an ADC (analog to digital converter), which would basically turn that audio signal into something the computer can understand. But basically it would always be a soundwave.
On the other extreme is a dedicated MIDI controller keyboard. e.g.
[img][650:314]http://www.gigasonic.com/images/maudioaxiom49.jpg[/img]
This basically has no internal sound-generating capabilities---so the only way you could "make music" with it would be to hook it up to something that does--i.e. a synth... these are often called "sound modules" if they're an external piece of hardware, or in the case of computers, they would be called Virtual instruments (also "softsynth"). In this situation when you play the keyboard you're sending a signal to the synth to say "play this note" and even "play this note with this specific velocity".
Similar to the purely audio example above... you need a way to interface with your computer. In this case you'd also need a soundcard... but one with MIDI capabilites so that the controller can talk to the software. It would not be sending any audio to the computer, just information to control audio.
Now just to confuse you... this process of the keyboard controlling a synth is what happens internally inside the things we normally call synthesizers... but it's all internal so we don't think about it (although as a note, it's not using MIDI inside it... just well, I don't know what it uses internally in that case).
See...
what you see here is the controller on the outside... the synthesizer part is on the inside (looks pretty much the same as the MIDI-only one right? Well, except hotter).
This synth, like pretty much every new synth these days, can also be used as a MIDI controller. So basically there are (at least) two connectors on the back : an audio out to send a pure audio signal to a soundcard to record it, and a MIDI out for if you separately want to just use the keyboard as a way to control sounds on your computer. Sometimes too there is another connector for if you want to receive MIDI signals---i.e. to control the internal synth of the keyboard.
The cool thing about MIDI is that the controller doesn't necessarily have to be a keyboard, it's cheesy but there are also MIDI guitars and even "wind controllers".
The other really practical thing about MIDI is that because it's merely instructions, MIDI allows you to easily manipulate what you record after the fact It's like with graphics--the same way that vector graphics allow you loss-less transformations to the image, like scaling up or rotating or whatever, a MIDI "recording" lets you edits the notes, and change the pitch and tempo without degrading the sound. Very practical for composers trying things out. Oh yeah and because it only registers what note to play and how, you can actually at any time just say: "Oh... this was a flute, but now I want to make it a bass drum". The software doesn't care, the "instrument" part is only like a "skin" over the notes.
There ends lesson 1 of MIDI (and also a brief tour of some of my synths... heh heh... well I don't have a modular). Don't know if it helped, but I could nerd out on this stuff for hours so... if you have any questions let me know.