The heart-rate sensor in smartwatches uses PPG or photoplethysmography. Put simply, this projects a green light onto the skin and the light that isn't absorbed by the tissue beneath the skin is reflected back to the sensor. Variations are then measured to calculate the heart rate.