They usually look for how long you’re in each stage of sleep, how well you oxygenate, heart patterns, and awakenings. All of these things, if not working correctly, cause us to get poor sleep and lose grey matter in our brain.
Apnea is really about oxygen delivery which can be hindered by something like our tongue, or our chest (obstructive sleep apnea), or even our brain not communicating properly (called central sleep apnea).
We can also have arm and leg twitching which wakes us up. Heart issues can play a role as well. There are others but I can’t remember them off the top of my head right now.