Your phone (if you’ve got the feature switched on) is listening for those specific keywords and supposedly ignores everything it hears before it hears that.
Obviously whether it’s actually doing that or not is another matter… how much do you trust Apple, Google, Amazon, Microsoft et all.