Realremo, Imagine just one mechanical switch that switches between +10V and -10V. Output of this switch after averaging (filtering) will be zero volts if switch was the same amount of time (for instance 1s) at +10V and -10V positions (total cycle time of 2s). Manipulating ratio of times changes output voltage.
For instance:
1.5s at +10V and 0.5s at -10V will result in output of +5V because (1.5*10+0.5*-10)/2=+5
or
0.5s at +10V and 1.5s at -10V will result in output of -5V because (0.5*10+1.5*-10)/2=-5.
Real frequency of switching is very high (in order of 500kHz) where mechanical switches would not work - hence Mosfet transistors (fast switches). Mosfet transistors are even manufactured in two different technologies for use as switches or linear transistors.
For instance:
1.5s at +10V and 0.5s at -10V will result in output of +5V because (1.5*10+0.5*-10)/2=+5
or
0.5s at +10V and 1.5s at -10V will result in output of -5V because (0.5*10+1.5*-10)/2=-5.
Real frequency of switching is very high (in order of 500kHz) where mechanical switches would not work - hence Mosfet transistors (fast switches). Mosfet transistors are even manufactured in two different technologies for use as switches or linear transistors.