how does this specific line of code work?
#define HRM_FLAG_MASK_HR_VALUE_16BIT (0x01 << 0) /**< Heart Rate Value Format bit. */
That line of code doesn't "work", as such, because it doesn't actually perform any job. It just gives a name to numeric constant.