I can give a very basic explanation based on my very limited understanding!
Essentially, GSD is a translator. GSD has lots of "commands" to do various things with media, HA, etc - you can see these inside GSD templates referenced by numbers like #193/192 for power on/off. Or #89/90 for volume up/down. (from memory!)
When the native DCE protocol is used by a remote device to send a DCE message either explicitly to your GSD device number, or implicitly to your GSD device by virtue of it being: in a group of devices, a category of devices or somewhere along a audio/video pipe - this message is interpreted by the GSD binary code.
That code then looks at the associated device data in the database to determine whether the necessary GSD "commands" are implemented by the device to complete the task that the DCE message requested. In the device configuration data you will see these GSD "commands" and you can add/remove whichever ones you want your GSD device to be able to handle. Each of these "commands" then have a text field in which you can place Ruby code.
So effectively the GSD binary is translating DCE messages into the correct Ruby code required to perform the task. Of course you can do normal programmatic stuff in Ruby, but ultimately most device templates then have a Ruby command to send/receive text strings to a serial port. So you can use the Ruby code to form the appropriate text string to send to the physical device you are controlling based on the protocol that it accepts.
So if LMCE decides that an MD has been idle for a period and wants to powersave, it will send a power off DCE message to the audio and video pipes configured for that MD's entertainment area. If you are controlling, say, a TV and Amp from that MD, these devices will have an audio and video pipe from the MD to them. So the DCE message gets routed to the 2 GSD devices controlling your Amp and TV. These two GSD devices will determine whether command #193 is implemented for each device. And if so, will execute the Ruby code associated with those command numbers. That Ruby code can then send the correct power off string to each of the physical devices.
I wrote this with serial in mind, but the principle holds for IR as well. I'm sure the other guys will correct anything I got wrong.