The circuit employs negative feedback and utilizes the very high gain of the op amp. The op amp will try to keep its non-inverting and inverting inputs at the same voltage \$V_{\text{set}}\$ due to its very high gain. Then by Ohm's law
$$I_{\text{set}} = \frac{V_{\text{set}}}{R_{\text{set}}}$$
Negative feedback causes the op amp to adjust the transistor base voltage so that \$I_{\text{set}}\$ is constant even with a varying load. If the varying load causes a temporary increase in \$I_{\text{set}}\$ then the voltage at the op amp's inverting input will temporarily rise above the non-inverting input's. This causes the op amp's output to decrease, which lowers the transistor's \$V_{BE}\$ and therefore its \$I_{C} \approx I_{\text{set}}\$.
Similarly, if the varying load causes a temporary decrease in \$I_{\text{set}}\$ then the voltage at the op amp's inverting input will temporarily fall below the non-inverting input's. This causes the op amp output to increase, which increases the transistor's \$V_{BE}\$ and \$I_{C}\$.
"Vin is 5V, so Vout should be 50,000V."
Why? The OpAmp amplifies the the difference between the + and - inputs, not just the value on the + input!
OK, you might start with: the output is at 0V, and the input (connected to the + input) is 5V. What you have done is apply a 5V step to the input.
Now what happens is that the OpAmp starts to rise the voltage on the output. It can't do this at once, so it will rise 'slowly' (for some rather fast value of slowly, which has a technical name in OpAmp world: the slew rate, which is an importnat charactreistic of a real OpAmp). When it reaches 5V, this is fed back to the negative input, at which time it compensates the 5V at the + input, so the OpAmp no longer tries to rise its output level. (To be really accurate: this happens a little bit earlier, when the difference is 5V/10k.)
Depending on timing characteristics, the output might 'slowly' settle to 5V, or overshoot the 5V, drop below 5V, etc (oscillate towards 5V). If the circuit is designed badly the oscillation might increase (and never end).
Best Answer
Roughly speaking, you're describing the effect of negative feedback, for which the intuition is that it brings/forces the system to an equilibrium point.
The reason why the two voltages at the input terminals are essentially the same (putting aside several practical factors) is in part the negative feedback, but mainly the fact that the gain of the amplifier is extremely high.
The simplified/ideal model of the op-amp describes it as having infinite gain. So, if the output is not driven to saturation, then a finite output voltage must mean a zero input voltage (i.e., zero difference between the two input terminals). In reality, the gain is not infinite; it is just extremely high; thus, the difference between the input terminals is not really zero; it is just extremely close to zero.
The negative feedback plays the role of maintaining the system inside its non-saturating / linear behaviour, which combined with the above makes the input differential voltage essentially equal to zero.