The function analogWrite(pin, value) is used to output a PWM signal. The pin number used for the PWM output is pin.
The PWM (Pulse Width Modulation) is a method of controlling the average voltage.