"Nearly every system in your automobile is controlled by onboard computers these days, especially your engine and transmission functions.
'Fail Code' conditions, or 'Limp Mode', happens when the vehicle computer recognizes a problem in it's logic. When an expected signal value from a sensor is sent to the computer and is not within the computer's programmed specifications, 'secondary' programs are activated by the computer to strive to protect the transmission from any damage the improper sensor signal might cause to occur, be signaling, or contribute to.
In other words, the computer is always expecting certain signal values from certain sensors i.e. the temperature sensor, the speed sensor, the throttle position sensor or MAP sensor, etc. As long as these signals are what it would normally expect for the current operating conditions and are normal based on all the other signals it is receiving from other sensors, it acts normally and accordingly.
If the computer, all of a sudden, receives some crazy signal from one of the sensors that is out of the normal range expected from this sensor, it is programmed to go into 'emergency' or 'secondary' measures.
These emergency measures vary depending on the severity of the defective signal. All of this is preprogrammed into the computer's logic by the manufacturer. The manufacturer has decided that as long as a certain parameter of a particular signal is sent from a sensor to the computer, all is well. The manufacturer decided that if this signal is higher than their highest parameter or lower than their lowest parameter, something is wrong with that sensor and the computer should make someone aware of the situation and take action to try to 'save' the vehicle systems or powertrain."
see more here