Since the iPhone 6S, Hey Siri is activated by a dedicated chip in the SoC. This enables low-power real-time detection of trigger words. Before, Hey Siri only worked with phones in the process of charging, because it was done with software, so a lot less efficient.
These voice-activated chips can be trained (as seen in a lot of other phones), but I'm not sure the software-powered Siri can be trained.