I believe it uses the same logic that Handoff does to determine what your "active" device is. If the "active" device hears the Siri request, it responds. Otherwise I think it prioritizes HomePod.
If multiple HomePods hear it, I'm not sure, possibly using volume to determine distance?