Leftover current after current limiting resistor
See this graph: -



It describes the forward current of a typical red LED as you apply a forward voltage.

With 1.7 volts applied across its terminals, virtually no current is taken i.e. the LED looks like an open circuit. With 1.9mA the LED takes 5mA i.e. looks like 380 ohm resistor. At 2V, the LED takes 20mA and looks like 100 ohms.

So, let's say you decide on an LED current of 5mA, from a 5V supply you need to "lose" 3.1 volts and this means a series resistance of 3.1V/5mA = 620 ohms.

If you applied a more simplistic rule of thumb and assumed the LED forward volt drop (for a wide range of currents) was 2V you would need to drop 3V across the resistor and if you wanted 5.9mA, you'd choose a resistor value of 3V/5.9mA = 508 ohms. The article you linked picked 510 ohms as the current limiting resistor and this is perfectly fine.

Assuming the LED forward volt drop is 2V is a compromise on accuracy but it is a rule of thumb and not too inaccurate. Given that a typical red LED may vary its characteristics a little bit, there is little point trying to predict a resistor value more accurately.

For different LEDs, different characteristics need to be chosen to calculate the forward volt drop: -



The bottom-line is always read the data sheet and don't use LEDs that don't explicitly state what their forward characteristic is like.