In most GM cars and trucks there is a hidden system that most people are unaware even exists. From the moment you put your key in the ignition, there begins a constant line of communication between your key's security chip or transponder, to the ignition's lock cylinder, and then to the car's TDM (Theft Deterrent Module). These 3 parts are in CONSTANT communication. If the key is in the ignition, then these parts are sending signals to each other.
The security light illuminates when that signal gets broken, or not seen at all. When the communication breaks, the car misinterprets this as an attempt at theft and goes into antitheft mode. (like it thinks it's being hot wired) The car shuts down because it is not getting that signal from YOUR specific key. This is why the security light turns on and shuts down your vehicle. It will either turn off the starter, or the fuel injectors. The vehicle may run for 2-3 seconds before shutting down. This link explains it pretty well.
Do It Yourself GM Security bypass