Fan regulators are connected in series with the fan. All it provides is an impedance to the fan motor. There are multiple variations of these, the one shown is a rotary discrete level type. In these, there are usually 6 rotatable positions for the knob(incl. OFF). At each position, there is a metalised film capacitor which provides impedance in series. For lower positions, lower capacitance kicks in, meaning higher impedance (Capacitance and Impedance have inverse relation) to AC. There are 3 capacitors (1uF, 2.2uF, 3.2uF usually) for 3 positions, for the fourth position they put 2 of these in parallel to get a higher capacitance and an even lower impedance. At position 5, its direct connection to the motor for no impedance and full motor speed.
Usually, the fault in these devices is that the higher capacitors blow up(Fan won’t work on higher speeds) Or get shorted, so your fan will run at lower speeds but when you switch to level 3 or higher, the fan always runs in high speed irrespective of the position. You just need to buy a rated capacitor(INR 10, $0.1) and solder it to the board to fix the problem.
It’s not that these regulators are expensive to replace, like in my case, I can’t find the same model of regulators in the shop anymore and it will ruin the aesthetics of the rest of the switches on the board, to have a weird design regulator sitting there.