What does a TRIAC do?
A triac is used to control an AC load, just like a transistor can be used to control a DC load. It is drawn like a couple of diodes in each direction which are then triggered to turn on. They will turn off when the current drops below a certain threshold. So if you just want it on or off you leave the signal on or off and at the next zero-crossing of the AC it will be in that state.

You can also get fancy and turn it on only sometimes, which is where the microprocessor programming comes in. Once you have a zero cross detector you can then turn it on in a "gentle" manner as well as keeping trac of percentages on/off if you are trying to reduce the power or control a speed by leaving it off for some cycles.