Potentiometer uses Arduino 5V power and sets a value.
This value is sent to the NPN Transistor which will activate the DC motor running on a 9V Battery. (The potentiometer value actually goes to the Arduino as an input and then a PWM signal is sent to the transistor according to the potentiometer reading)
The higher the current from Potentiometer, the more current the Transistor allows through, hence controlling speed (Click on Potentiometer and then spanner icon to adjust speed)
The LED is there for reverse current generated from the DC motor. (Not sure this is correct since the diagram never shows any current going through the LED)