This is the circuit of a simple electronic programmable dimmer.
Once the mains voltage crosses zero volts, it activates the binary counter and loads into it the present value.
The binary counter counts until it overflows, activating the AC switch which is made by two bipolar transistors in a SCR configuration, along with a diode bridge rectifier.
The lightbulb turns on only after the AC switch has been triggered. When the mains voltage crosses zero volts again, the AC switch turns on and the cycle begins again.