The Federal government has several central registries. The social security database for example knows which socials belong to citizens and which do not. The IRS database another as are the passport and visa databases.
The problem is that they aren't interconnected in any meaningful way by design so the bulk of the work gets pushed onto states. Real ID forced a lot of the states to get their act together but it's still a bit of a goat rodeo in places.