I see that there is a partial answer to this quesion here: Smart trainer power meter Cadence question. Apparently the app has a hierarchy of devices and chooses the “best” device based on that hierarchy. That is very cool.
I still wonder how ERG mode works.