Exactly. Gadgetbridge reverse engineered the protocol so it can configure all the same settings the Garmin app can, notifications get forwarded to the watch, the watch sends its sensor data, gps tracks, etc and Gadgetbridge knows what to do with the data so it’s displayed in graphs and lists, etc.
And yeah, if you get a watch without wifi or don’t connect one with it to a network, then all data i/o is going to be exclusively bluetooth with Gadgetbridge, which specifically avoids the network permission (so there’s zero chance of anything leaking to a server somewhere.) That’s why it communicates with a weather app fur that data instead if pulling it in itself.
It also works with more than just smart watches; like I can use it to configure the buttons, noise cancelling state, etc on my bluetooth headphones.
It’s definitely not perfect, like I can grab a nap and not have it notice sometimes so I assume there are a bunch of heuristics at play that create a “best guess”.
That said, how rested I feel does typically line up with the number of hours it shows (regardless of how long I’ve actually spent in bed), and it has a short description about the quality of sleep like “restorative” or “not enough rem” that further lines up with how I feel.