The defrost cycle is activated by a controller in the outdoor compressor. Many of the older units, they were pretty basic, when the outdoor temp got below 40, a timer was activated that would count down a particular amount of time that could be set by the install technician. Around here, it was usually somewhere between 60 or 90 minutes. When that time came, the controller would activate the reversing valve, shut off the outside fan, and send 24 volts up the defrost line back into the house so the heat strips would activate. Today's systems are a bit more sophisticated because they use electronic computers. They can measure the temp of the coil and determine the proper length of the defrost cycle, some can even run faster defrost intervals depending on humidity, airflow, and temperature among other variables.
There are a few variations of that thermostat setup I stated earlier too if you have fossil-fuel backup heat, which have become very common in these parts. A forced air furnace has a built-in fan switch that will activate the fan when the heat exchanger temp gets above it's preset temp. Normally, when you are in heat mode in a system with electric backup, when auxilary heat is called, COMPRESSOR, FAN, and AUX HEAT are all "high". With a fossil-fuel system, when auxilary heat is called for, the COMPRESSOR and FAN lines are de-activated, shutting down the outdoor unit, and the indoor fan until the heat exchanger is up to full temperature. Once the auxilary heat is satisfied, it will go back to heat pump mode and shut off the fossil-fuel system.
Some dual-fuel systems also have an outdoor thermostat on the defrost board too. They will activate the defrost line at usually 40-35 degrees when the heat pump becomes inefficient. The thermostat will then sense this and cut off the COMPRESSOR and FAN circuits. Any time the thermostat calls for heat when this condition is met, the fossil-fuel furnace will provide the heat, and not the heat pump, thus saving electricity.
I have also seen a home where they have hot-water heating in conjunction with a heat pump. In these systems, the AUX HEAT line activates the circulation pump on the boiler to distribute heat to the radiators. When the boiler gets too cool, the burner is lit using an internal thermostat. These systems sometimes leave people scratching their heads, because the boiler's burner will sometimes run even when the system is in heat pump mode, or not even calling for heat, leading the user to believe the system is heating, when all it's doing is "topping off" the heat in boiler due to heat loss.