By compressing the air energy has been added to the system. Some, but not all of the energy is extracted through expansion or lost via heat transfer as it transits the heater ducts. The energy that remains manifests itself in a higher temperature when the air is brought back to ambient pressure. Bottom line - there's more energy in the exiting air than in that which enters the engine inlet.
-Stan-