It doesn't have to be 10,000 of votes as close as these elections have been recently. Since the 1996 election, every single election has been super close. If you give the losers, Gore, Kerry, McCain, Romney, and Hillary, a few thousand votes in the right states, maybe even less than that in extreme cases like Gore, they win their respective elections.
This election may be closer than any of them considering the disdain for Trump, Biden's speech problems, and the current crazy issues. While there might be a debate about the level of cheating that occurs because of mail in ballots, Trump is 1000% right that it could influence the election way more than Russian ads on Facebook.
Who decides if a ballot counts or not? It will end up being the Supreme Court as the declared loser in a battle ground state sues that state. There will be as many as 10 cases going on at once. The side that loses will declare the winner illegitimate.
Basically, it will be a huge mess. If Biden loses, I guess the rioting will start back up and COVID will spread. If Trump loses, he may not leave the Whitehouse. In that situation, there will probably be rioting in Washington D.C.
Feel free to correct me if you think I am wrong somewhere, but you know deep down this mail in ballot idea was a very bad one. I pray we, the people, survive all this craziness.