In the health app, there is prioritization settings.
When you first connect a watch it puts itself at highest priority.
For a given minute, based on the priority setting - it will take this reading.
So, for example, if you leave your watch at your desk for a bit, and have your iPhone in your pocket, in the Health App (on your iPhone) the steps for the day for this duration when your watch is not recording but your phone is, your steps will come from your phone.
If you leave your phone at your desk, and walk around with your watch, the opposite is true, all step data will come from your watch.
If they are both on you at the same time, with default settings, the watch data will be whats used.
NOTE: this setting is for the health app - it has no effect on the activity app on your watch or phone. The activity app, and the "ring" that you try to complete each day are purely based on things recorded on the watch, as far as I can tell.