My understanding of a typical jet engine is that when running, the turbine extracts energy from the hot exhaust gases. This drives the turbine, which is coupled to the compressor at the front of the engine. As a result, when the turbine accelerates, the compressor accelerates. This increases the mass flow rate of air into the engine, which in turn increases the mass flow rate out of the engine, producing more thrust. It also means more energy is extracted by the turbine, which drives the compressor even faster.
It seems as though it is a cycle that should continue to increase without limit. Therefore, my question is what stops the engine spin speed from increasing to infinity (ignoring material limits)? Why does the spin speed of the engine stabilise if the compressor and the turbine are continually driving each other at increasing rates?