How does HealthKit resolve recording of the same activity by multiple sources?
HealthKit is pretty smart with your data. For every source in the Health app, you can set the priority of difference apps. Tap one of the metrics in the Health app tap Share data > Edit to drag sources in the right order. 

If other apps request data, HealthKit will automatically merge the datasets, probably based on timestamps. It picks the high priority app first, and fills the gaps in data with the number 2 app, etc. 

This WWDC would be a great start to get a complete overview.