Change the Potentiometer position to set the control voltage for opening or closing the mosfet. The mosfet is one half of a voltage divider. Watch how the resistance of the mosfet changes according to the control voltage. The resistors between the potentiometer and VDD and GND are set so that the range of the voltage divider applies to the linear region of the mosfet (usually somewhat like 1.7V to 2.7V). Only good for positive voltages. Mosfet is not linear in the lower DS voltages.
Anyways good to emulate high resistance potentiometers e.g.