The DIAC(Diode AC bi-directional switch) is a kind of diode. It switches AC voltage or trigger to a gate of the TRIAC. Adjust VR to Adjust the speed or Brightness of Load.
We know the AC main is the Sine waveform. Use Triac is an electronics switch. It works very fast in AC. If we feed a different waveform in the gate of Triac. We can control it easily.
And Capacitors and resistors are basic components to change the waveform of AC.