The AP has called winners in elections for more than 170 years. Here's how it's done

FILE - In this Feb. 5, 2020, photo Associated Press Washington Bureau Chief Julie Pace, right, looks over a headline with deputy managing editor for operations David Scott in the newsroom at the Associated Press in Washington. (AP Photo/Jenny Kane, File)

One question will be asked over and over on election night: Who won?

The Associated Press will answer that question for nearly 5,000 contested races across the United States and up and down the ballot, from president and state ballot measures to a variety of local offices.

The AP has compiled vote results and declared winners in elections for more than 170 years, filling what could otherwise be a critical information void of up to a month between Election Day and the official certification of results.