Why do turbine engines work? I know roughly how a turbine engine (let's say a gas turbine producing no jet thrust) is supposed to work:

The compressor forces fresh air into a combustion chamber, where it reacts with fuel to become hot exhaust gas. On its way out of the engine, the exhaust gas drives a turbine, and the turbine both makes the compressor go, and has enough leftover torque to do useful work.

However, how do the exhaust gases know they're supposed to push on the turbine blades to drive the shaft, rather than push back on the compressor blades to retard the drive shaft in equal measure?
In a piston engine there are valves that force things to flow in the correct direction at the right times. But with the turbine engine everything is openly connected all the time. Shouldn't that mean that the pressure differential the compressor must work against is exactly the same as that which is available to drive the turbine?
Something magical and irreversible seems to happen in the combustion chamber.
The descriptions I can find that go deeper than the three-step explanation above all seem to jump directly to a very detailed model with lots of thermodynamics and fluid dynamics that make my head spin. Is there an idealized system with fewer variables that I could think of to convince myself we're not getting something for nothing here (e.g., might the working fluid be incompressible, or massless, or have infinite heat capacity or whatever)?
 A: The air entering the combustion chamber from the compressor is moving at up to 600 mph. So when the fuel-air mixture burns and expands it has a choice of going upstream against a 600 mph wind or downstream through the turbine where there is relatively little resistance. Obviously it does the latter.
Jet engines are designed so the combustion doesn't raise the pressure in the combustion chamber very much. The exhaust gas flow out through the turbine is fast enough that the pressure in the combustion chamber remains low. Far too low to push the exhaust gases upstream and out through the compressor.
A: Forget the turbine blades for a moment.
Look at the combustion chamber.
At one end, there is a compressor that raises the pressure to many atmospheres.
At the other end it is completely open.
So there is a large pressure gradient.
Now you inject heat into the compressed air, causing its volume to expand enormously.
Where's it going to go?
Out the low pressure end, or the high pressure end?
The thrust is the difference in mass flow momentum between the back and the front.
Now put the turbine blades back in.
The power needed to run the compressor is only a fraction of that going out the back.
The turbine blades are made big enough to drive whatever mechanical power drain is needed.
A: The first thing you need to understand about combustion engines is that it's impossible for any ideal engine (even your car engine) to produce zero gross thrust. At the end of the thermodynamic cycle, the stagnation pressure and stagnation temperature of the working fluid are always greater than ambient, and so the flow always expands to a velocity greater than the free stream. This thrust is negligible in non-propulsion applications because of the exhaust design (and in fact net thrust can be negative when frictional effects are included), but the specifics of that topic are not germane to this discussion.
Secondly, we need to be more precise in our language. In particular, we need to highlight the very important distinction between static and stagnation fluid properties (static properties are independent of reference frame, while stagnation properties are not). This is very important because it is only static pressure gradients that cause changes in the local flow velocity. By design, the static pressure rises in every bladerow of the compressor, but the stagnation pressure increases only in the rotating bladerows. The static pressure falls in every bladerow of the turbine, but the stagnation pressure falls only in the rotating bladerows. You are correct in suggesting that the flow is pushing against the action of the compressor. This is because the flow is continually fighting an adverse pressure gradient; the flow is being pushed uphill against its natural inclination towards lower pressures. The turbine, on the other hand, is merely an obstruction as far as the flow is concerned, preventing it from expanding immediately down to the lowest pressure available (ambient). The flow doesn't mind doing some work for us, because it is being allowed to expand to lower static and stagnation pressures. Thus, a turbine can't really "stall" and reverse the flow direction in the way a compressor can. We can get away with the pressure rise in the compressor only because it occurs rather gradually (notice how little flow turning takes place in a compressor bladerow (<20 deg.) compared to a turbine (>100 deg.)). The flow does not shoot out of the front of the engine (normally) because the blades are meticulously designed to achieve the maximum compression possible before that happens (without universal success mind you, just ask any F-14 pilot before the GE-F110 engine upgrade).
Most relevant to your question, the stagnation pressure drop across the turbine is absolutely not the same as the pressure rise across the compressor it is mated to; it is always less. Why? Because for a given pressure ratio, the change in the stagnation enthalpy of a fluid increases with its initial temperature. Or, alternatively, the required pressure drop for a given chnage in enthalpy decreases as the initial temperature increases. The turbine powers the compressor, so the power produced by the turbine is consumed by the compressor (plus accessory drives). However, the turbine inlet temp is substantially greater than the compressor inlet temp, so the turbine exit stagnation pressure will necessarily be greater than the compressor inlet pressure, which is essentially equal to ambient.
If you are interested in the mathematical equations, the specific work (input) for the compressor and the specific work (output) of the turbine [kJ/kg] are:
$w_c=\frac{C_{p_c} T_{0_2}}{\eta _c}\left[\left(\frac{P_{0_3}}{P_{0_2}}\right)^\frac{\gamma_c-1}{\gamma_c}-1\right]$ and $w_t=\eta_t C_{p_h}T_{0_4}\left[1-\left(\frac{P_{0_5}}{P_{0_4}}\right)^\frac{\gamma_h-1}{\gamma_h}\right]$
where the subscripts "c" and "h" refer to cold and hot values, respectively, and $\eta$ is the isentropic efficiency of the compressor or turbine. A piston engine performs the actions of "intake, compression, expansion, exhaust" in the same location at different times, while the gas turbine engine performs these same functions at the same time in different places. Hope this helps.
A: Before reading these answers, I have always wondered the same question. Now that I understand it I think I can simplify the answer a bit for everyone. 
We agree that there is a lot of pressure in the combustion chamber, so what causes it to go out the back rather than the front? Imagine for a second that the shaft connecting the compressor and the turbine has a gear box, and for every 1 rotation that the compressor does the turbine would do 10. This would make it 10 times easier for the hot expanding gasses to exit the turbine end rather than the compressor end. At the same time the hot gasses turning the turbine would have a mechanical advantage of 10 to turn the compressor. This would be sufficient enough to make the small amount of compression needed for combustion, and allow for the rapidly expanding gasses to have somewhere to escape to. 
Now instead of a gear box, this is all achieved by the difference in pitch of the fins to provide a mechanical advantage between the turbine and the compressor. 
A: Trying to simplify the answers given:
The compressor generates a certain volume of air at a high pressure. In the combustion chamber, this air is heated - this leads to a much larger volume of air.
Looking at a section of the turbine (tapering to smaller section as compressor stage approaches combustion stage) we see that this further encourages high density mass flow into the combustion stage.
At the exhaust stage the pitch of the fan blades is such that work is done by the fast moving air without causing a large pressure drop. In other words - it is "easier" for the air to go out the back.
But since there is far more air coming out the back (added a lot of volume by burning fuel) the fast that it is working "less hard" on the way out doesn't stop the engine from producing power / thrust. 
I think that is the key - given the choice, the exhaust gases move in the direction of the lowest pressure.
A: The key is the combustion of fuel in the combustor. This adds energy to the flow so there is plenty available for the turbine to drive the compressor.
Depending on flight speed, the intake does already a fair amount of compression by decelerating the flow to Mach 0.4 - 0.5. More would mean supersonic speeds at the compressor blades, and the intake ensures a steady supply of air at just the right speed. 
This speed, however, is far too high for ignition. The fuel needs some time to mix with the compressed air, and if flow speed is high, your combustion chamber becomes very long and the engine becomes heavier than necessary. Therefore, the cross section leading from the compressor to the combustion chamber is carefully widened to slow down the airflow without separation (see the section in the diagram below named "diffusor"). Around the fuel injectors you will find the lowest gas speed in the whole engine. Now the combustion heats the gas up, and makes it expand. The highest pressure in the whole engine is right at the last compressor stage - from there on pressure only drops the farther you progress. This ensures that no backflow into the compressor is possible. However, when the compressor stalls (this is quite like a wing stalling - the compressor vanes are little wings and have the same limitations), it cannot maintain the high pressure and you get reverse flow. This is called a surge.
The graph below shows typical values of flow speed, temperature and pressure in a jet engine. Getting these right is the task of the engine designer.

Plot of engine flow parameters over the length of a turbojet (picture taken from this publication)
The rear part of the engine must block the flow of the expanding gas less than the forward part to make sure it continues to flow in the right direction. By keeping the cross section of the combustor constant, the engine designer ensures that the expanding gas will accelerate, converting thermal energy to kinetic energy, without losing its pressure (the small pressure drop in the combustor is caused by friction). Now the accelerated flow hits the turbine, and the pressure of the gas drops in each of its stages, which again makes sure that no backflow occurs. The turbine has to take as much energy from the flow as is needed to run the compressor and the engine accessories (mostly pumps and generators) without blocking the flow too much. Without the heating, the speed of the gas would drop to zero in the turbine, but the heated and accelerated gas has plenty of energy to run the turbine and exit it at close to ambient pressure, but with much more speed than the flight speed, so a net thrust is generated.
The remaining pressure is again converted to speed in the nozzle. Now the gas is still much hotter than ambient air, and even though the flow at the end of the nozzle is subsonic in modern airliner engines, the actual flow speed is much higher than the flight speed. The speed difference between flight speed and the exit speed of the gas in the nozzle is what produces thrust.
Fighter engines usually have supersonic flow at the end of the nozzle, which requires careful shaping and adjustment of the nozzle contour. Read all about it here.
A: I just had an epiphany. The engine works because the turbine is "larger" than the compressor.
For extreme simplicity, let's assume that the working fluid is incompressible and effectively massless (it has pressure, but its inertia is negligible compared to the pressure).
Assume further that the actual combustion is so finely tuned that the pressure stays constant during the combustion -- the gas simply expands at constant pressure, doing work against its own pressure as it does so.
Then the compressor and turbine really do operate across the same pressure differential, namely the difference between ambient pressure and pressure inside the combustion chamber.
At both ends of the engine, the power delivered to (or taken from) the drive shaft is the (common) pressure difference times the volume flow through the compressor/turbine. At this ideal level they are both the same kind of thing, except that one of them runs in reverse.
However, the torque is not necessarily the same. The turbine is constructed such that one revolution of the drive shaft will allow a certain volume of air to escape from the combustion chamber. (I suppose that is a matter of the turbine blades being mounted at a different angle than the compressor blades). At the other end of the shaft, one revolution of the shaft will push a certain smaller volume of air into the combustion chamber. It must be so because the gas expands during combustion.
This difference in volume-per-revolution means that the same pressure difference translates to different torques at the two ends of the engine.

As a completely idealized toy example we can imagine that the compressor and turbine are both made of the same kind of ideal reversible fan assemblies -- for each such unit, one crank of the handle will make a certain volume of air change places, and how hard the handle is to crank depends on the pressure difference.
The units that make up the compressor are mounted such that turning the drive shaft clockwise corresponds to air moving into the engine; the ones that make up the turbine are mounted opposite. Since the pressure difference is the same everywhere, the torque output from one turbine unit can drive exactly one compressor unit. But there are more turbine units than compressor units, and the additional ones produce surplus torque that can do work.
This corresponds to the fact that there's a net outflow of air from the combustion chamber, because new volumes of gas come into being as the fuel burns.
A: The compressor creates and maintains the pressure in the combustion chamber. If it didn't, you'd have what is called "compressor stall" in which airflow moves backward through the compressor with generally undesirable consequences.
The key point is that burning fuel inside the engine can't create more pressure than the compressor can deliver. Since combustion is increasing the energy in the gas (raising its temperature), that increase has to manifest in some way other than an increased pressure, and that other way is to increase in volume.
Anyway... the burning fuel in the combustion chamber increases the temperature, and consequently the volume of the working fluid (air). The higher volume of gas exiting the combustion chamber is capable of doing more work on downstream components i.e. turbine(s) than was done on the inlet air by the upstream components i.e. compressor stages. That difference in work, per unit time, is the engine's output power.
In the case of the high-bypass turbofan or turboshaft, all of the useable work goes into the turbine(s); some of it drives the compressor, the rest of it drives the application (front fan or output shaft).
In the case of the pure jet, energy in the hot gas which is not expended on the turbine accelerates the exhaust stream; that acceleration sustains the nozzle pressure which is the source of thrust.
A: I have the same question myself but I'll raise two points:
Firstly, the compressor is not just a turbine, but also, in many cases, kind of a centrifugal pump. In such a case, I don't think the pressure in the combustion chamber can push the pump backwards.
Secondly, in a high speed air-flow situation, the dynamics is quite different from the static one. Just like the wing which makes air pressure under and above different, there must be structures to control the air pressure inside the combustion chamber, that make the air  go where it is wanted.
A: I think Peter Kämpf's answer is very good and I know there are already a lot of answers to this question, but I want to suggest another way of looking at it:
Firstly, in order for the engine cycle to work, the compressor has to be started by a separate motor, so there is already a flow through the engine before you start the combustion. The combustion process adds a large quantity of heat energy to the flow. This extra heat energy will be carried to the turbine - it can't flow into the compressor because that would be against the prevailing flow through the engine. The heat can't travel back into the compressor by thermal diffusion because this is a much slower process and is dwarfed by the fluid convection.
So, my point is that the fluid flowing through the turbine has a lot more energy than the fluid flowing through the compressor. To address your question of why the pressure from the combustion chamber acting on the back of the compressor doesn't exactly balance the pressure acting on the turbine: it's true that there is a reverse pressure gradient across the final compressor stage (after all, that is the compressor's purpose). However, the flow through the turbine has enough energy to supply the compressor, whilst still having enough left over to shoot a nice big jet of air out the back of the engine.
I think you are oversimplifying the situation somewhat: the work done by a compressor/turbine stage is not just a simple function of the pressure differential across it. There are many other factors involved, such as flow velocity, flow area, compressibility, differences in heat energy/enthalpy. A jet engine is a very complex system and each section has to be very carefully designed to balance these various factors, as Peter Kämpf explains in his answer.
A: Let me chip in yet another explanation. This answer is similar to Anthony X's answer.

In a piston engine there are valves that force things to flow in the correct direction at the right times. But with the turbine engine everything is openly connected all the time. Shouldn't that mean that the pressure differential the compressor must work against is exactly the same as that which is available to drive the turbine?

Yes, absolutely. The gas pushes equally hard in all directions, so the compressor is working against the very same pressure differential that the turbine extracts energy from.
The key, I think, is that there's a greater volume of air passing through the turbine than the compressor. The power obtained or spent by moving air across a pressure boundary is equal to the pressure difference multiplied by the flow rate (the number of cubic meters per second). Since there's "more air" (by volume, not by mass) passing through the turbine than the compressor, the turbine is able to extract more energy than the compressor requires.
Why is there "more air" passing through the turbine than the compressor? It's because of the combustion, of course, but how does combustion produce "more air"? My understanding is that there are two ways that it does this:


*

*The gas after combustion is hotter than before combustion, and hotter air at a given pressure has greater volume.

*Jet fuel contains hydrogen. For every 4 atoms of hydrogen (4 H) in the fuel, 1 molecule of oxygen (O2) is converted into 2 molecules of water (2 H2O). So, disregarding temperature, the oxygen that reacts this way doubles in volume.


(I think it's strange that oxygen molecules take up the same volume as water molecules, but that's the way it is! According to the ideal gas law, it doesn't matter what the gas actually is.)

Now, why does the gas go in the correct direction in the first place? As far as I know, that can't happen spontaneously; you have to start the engine by spinning it some other way. But as long as the engine is spinning, the compressor will keep the air moving in the correct direction; and as long as the air is moving in the correct direction, the turbine will keep the engine spinning!
A: I'm working from memory here, so bear with me. 
In a turbine engine, from front to back, there is the compressor section, the diffuser, the combustion chamber(s), the turbine section and the exhaust section.
Your question asks why doesn't the hot expanding gas from the combustion chamber flow back out through the compressor.
Well, actually in certain circumstances, it does. When starting a turbine engine, the RPM of the compressor has to be brought up to a minimum value before the fuel is added and the igniters are excited. When fuel is ignited before the turbine reaches minimum RPM, it's called a hot start, and flames can go the reverse way. This can also happen with a compressor stall. (Insufficient incoming airflow into the inlet for the given power setting)
This minimum RPM allows a sufficient amount of airflow created by the compressor section to be brought into the diffuser, which acts like a venturi in reverse, expanding the volume of the incoming air, lowering it's speed and most importantly raising it's pressure. This raised pressure at the diffuser is what creates the pressure differential nescessary to keep the combustion gasses flowing back through the engine, instead of out the front.
A: 1) Compressor builds up pressure.
2) In combustion chamber, gas is allowed to expand while combustion maintains (about) constant pressure.
3) From there on gas expands through the generator.
Therefore, the pressure is decreasing after compressor stage throughout the rest of the engine.  Therefore, gas 'knows' where to go.
Obviously, this mode of operation depends strongly on the rate of fuel injection.  If not controlled properly, it leads e.g. to compressor stall.
