tinman13kup:
You are not so much "setting" anything, but rather providing the requirements of the device. The led requires the Vf to operate due to it's construction, and is restricted to max If.All components are restricted in some matter or another, some more-so than others. Resistors are limited by Watts, capacitors by voltage, inductors by current, ic's by all the above. It's up to the designer to ensure that the parameters are maintained. Exceeding those parameters generally results in destruction of the device in all cases.
Well, I mean, in the context of my question, "setting" and "providing the requirements" are the same thing.
I knew from the data sheet that the LED requires a max of 20 mA and a forward voltage of ~2V. "Providing the required" / "setting" the current at 20 mA is straightforward. But I wasn't sure how to "provide the required" / "set" the voltage difference across anode and cathode at ~2V.
You have to explicitly provide the 20 mA current because the device can't really self-regulate its own current draw. But the 2V forward voltage is something that it does provide for itself (within reason) owing to the properties of the p-n gate. That's what I didn't know.