A turbojet works by compressing air, heating the compressed air while keeping pressure almost constant, and running this heated air through a turbine which will expand it again. The work done while expanding air in the turbine is needed to run the compressor, and the heating in the middle is needed to add enough energy so the turbine will spin and the gas leaving the engine will still have more impulse/momentum (speed times mass) than the air which entered the compressor. At the end of this process, the air leaving the turbine will turn the remaining pressure into speed in the exhaust nozzle, so the gasses leave the engine at a higher speed, but the same pressure with which they entered the engine.
Adding more fuel to the combustion will increase the heat and speed of the gasses entering the turbine, so more work can be done here. This excess work will speed up the turbine, and with it the compressor, so more air gets pumped into the combustion process, until a new balance has been attained where the heat energy added in the combustion will just be enough to keep the engine spinning at its new speed. RPM and fuel flow go up and down together, but within strict limits and not linearly. Increasing fuel flow when the intake cannot provide more air, or increasing it too quickly to allow for spinup, will lead to a compressor surge, flow separates at the compressor blades and mass flow through the compressor collapses. Shortly after, the turbine will start to melt from the excessive gas temperature. To avoid improper throttle commands, modern jet engines are filtering commands through a computerized control system, so the pilot has fewer opportunities to screw up.
Every stage of the compressor adds a pressure increase, and faster rotation speed means more air throughput and an increased compression ratio. By spinning faster, the compressor can increase the pressure in the combustion chamber and increase mass flow, diluting the fuel-air mixture. Now the air entering the turbine flows faster but is cooler, because the same amount of fuel has to heat up a higher air mass per time. The turbine works like a compressor in reverse: After each turbine stage the air is expanded and cooler than when it entered this stage. The turbine will spin as fast as the energy given off in the expansion process allows it to turn the compressor, and the mass flow and entry temperature determine how much energy is available.
The rotation speed of the turbine at idle is roughly 50% of the speed at full thrust. The relation between thrust and RPM is rather complex, if you want to study it, I recommend simulation software like GasTurb.