Inside Hey Siri
In 2017 Apple explained how the iPhone keyword works. Every few milliseconds the sound goes through a small network on the always-on processor, with five layers of 32 units. When the score goes over a threshold, it wakes up the main processor, which runs a bigger network, five layers of 192 units, on the same piece of sound.
There are two thresholds, one for each stage. Apple tuned them by counting false alarms over many hours of normal speech where the word never comes up. A year later it added recognition of the voice of the phone's owner.