The potentiometer is a variable voltage divider
A potentiometer has three terminals. The two outer terminals connect across a supply. The middle terminal, called the wiper, provides a voltage that changes as the knob turns.
With a 10 kΩ potentiometer connected across 5 V, the wiper can produce a voltage from approximately 0 V to 5 V.
The microcontroller measures the voltage
An Arduino Uno's 10-bit analogue-to-digital converter (ADC) represents the input as a number from 0 to 1023 when using the default 5 V reference.
Zero represents approximately 0 V; 1023 represents a voltage close to the reference voltage. The reading is a digital representation, not a direct measurement in volts.
PWM controls the LED's average power
The Arduino Uno does not produce a continuously variable analogue voltage on its PWM pins. Instead, it switches the output rapidly between LOW and HIGH. Changing the fraction of time spent HIGH changes the duty cycle and the LED's apparent brightness.
On an Uno, analogWrite() uses values from 0 to 255. Pin 9 supports PWM.
Key distinction: the potentiometer produces a variable voltage, the ADC measures it, and PWM switches the LED output rapidly. These are three related but different operations.