What is the specific function of a triac inside a soldering station?
A triac can be used to switch AC power on and off to the heater in the soldering iron, or it can be used to phase control the power to get smoother control. 

Triacs are only useful for switching low frequency (such as mains frequency) AC power. Once switched on they stay on until the current through them drops to near zero (tens of mA typically). So they can only switch at a maximum of double the mains frequency. 

In a good soldering station you will have a temperature sensor and closed-loop control of the soldering tip temperature. In a less good one you may have open loop control of the power to the heater, like a light dimmer.