I believe it has to be reported through the healthcare system. In the US, you have personally identifiable information that links to your case and outcome. If you get a test, your information is gathered. If you never call back or show up as returning in the "system", then one may infer that you had a mild case and recovered, although I don't know if that is actually the way they are recording the metric (they would assume you got better if you never showed up again for a certain period - say 14 day). When I think of 'recovered' I think of a case that was admitted to a hospital and later was discharged, and then wasn't seen again after a certain period, like maybe a week, or there was a subsequent test that showed no more coronavirus. People that are exposed during a quarantine situation (eg a cruise ship) are closely tracked.
Those are just the mechanics I can think of. I'm not a nurse or doctor, just an engineer with my own view of these thing.
EDIT: I would assume the CDC is reporting once a day on the major stats, and they have access to case outcomes for the US health system. They probably have queries that filter out cases diagnosed as COVID-19. John Hopkins either has similar access, or just grabs the CDC report. Something like that. I could be wrong.