How does healthKit and core location measure distance?

Just curious about how healthKit and core location measure distance. From the apple’s documents, core location using wi-fi, GPS, Bluetooth, magnetometer, barometer, and cellular hardware to gather information, but what kind of mechanism is used to determine currently iPhone using GPS or wi-fi or Bluetooth or magnetometer or cellular hardware to measure distance? Does healthKit use an accelerometer to measure distance?