Flow sensors in the machine detect your breathing. (This is how EPR or C-Flex can synchronize to your breathing.) It can also detect lack of breathing (apnea). In the lab, the cannula in your nose detects breathing (or lack of) in a similar manner.
What the machine can't determine is the type of apnea (central, obstructive, or mixed). The straps around your chest and abdomen in the lab allow that determination by sensing breathing effort. It also can't determine sleep stages, heart rate, or limb movements.
_________________
Respironics Auto M Series, Pressure: 12 cm
Fisher & Paykel Opus 360 Nasal Pillows
My Sleep Blog