the declared winners of each state are decided by the media (
https://www.ap.org/en-us/topics/politics/elections/how-we-call-races). a bunch of media organizations are licensed to do this i think. so when a state is called, it actually means jack stuff. media companies think that the candidate will likely win, so they can call it even before votes are fully counted. they do this because otherwise it would take states weeks to fully count their votes (see: this week's election). it takes them this long even in normal elections that are not influenced by covid. back in 2000 they called florida's victor i think 3 different times until they finally settled on bush at the end of all the recounts and supreme court activity n stuff
the actual president of the united states will be decided sometime in december by the electoral college. idk how it works for senate/house races though