I'm not sure what you're missing, but here's an explanation of the shunt-regulator-based constant current sink.
Assuming the h
FE of the transistor is high, the base current is negligible, so I
E and I
C (which is the output current I
OUT) are almost exactly the same. So the output current produces a voltage drop across R
E, i.e. a voltage at V
E, which is proportional to the output current.
The TL431 (or whatever shunt regulator you use) "watches" V
E and as soon as it reaches the shunt regulator's internal reference voltage V
REF (internal to the shunt regulator) it starts to conduct sharply through its anode-cathode path. This draws extra current through R
B and makes V
B drop. This makes the transistor conduct less strongly, so its collector voltage rises.
An equilibrium is reached where the transistor is conducting just strongly enough to produce enough emitter current to cause V
E to match the shunt regulator's internal V
REF. Since I
C is approximately equal to I
E, the output current is controlled to the same value.
Using a TL431 , if RS and Vref sets the current, when the VF changes in the LEDs that are the load, Vref changes.
Which V
REF are you talking about? The V
REF inside the shunt regulator? That doesn't change. V
E changes, but the shunt regulator responds immediately to the change by conducting more or less strongly, so V
B changes, and the transistor conducts more or less strongly, to keep V
E equal to the shunt regulator's V
REF.
The circuit actually regulates V
E, and because V
E appears across R
E and is therefore proportional to I
E, I
E is regulated. Then because I
C is almost identical to I
E (the only difference is due to I
B, which is, or should be, negligible), I
OUT is also regulated.
This is why it's important to use a high gain transistor if you want good accuracy. A MOSFET is even better, because its gate current at DC is zero.