Counting ballots is a long process that continues well after Election Day. It includes counting in-person and mail-in ballots, verifying provisional ballots, and examining and re-tabulating all votes (either by hand or machine) to make sure they were counted properly. Once this is done, the results are certified by local and state elections officials. Depending on how close the race is, voters can even ask for a recount (which may or may not be granted).
The election results summarize how many votes were cast in each contest. In addition to these official results, many news outlets use data from a variety of sources to predict the outcome of each race. This can include public polls of registered voters, early in-person and mail-in ballots counted by officials, and patterns from past elections. This information is collected by reporters who update their projections throughout the election.
Some states also have procedures to correct clerical errors in the vote count after the elections are over. This is called a “canvass” and usually takes weeks or months. This can involve a hand or machine recount of ballots to determine whether there are any votes that were miscounted, and how many. A court decides if the disputed ballots should be included in the final results. This process is a way to ensure that every vote counts, and that the winner truly earned the most votes. It can also reduce partisanship and improve perceptions of electoral integrity.