How does Siri recognize me saying "Hey Siri"?
"Ok Google" is described in many publications by Google

Automatic Gain Control and Multi-style Training for Robust Small-Footprint Keyword Spotting with Deep Neural Networks

Convolutional Neural Networks for Small-Footprint Keyword Spotting

It is based on DNN specifically trained for keyphrase and runs really fast. It does not consume a lot of power even on mobile.

Alexa spotting is implemented by the same guys and available as Snowboy

UPDATE: Apple describes their implementation here.