This election may lead to some seldom used and convoluted procedures, and Trump would have the advantage. From Graham Allison at nationalinterest.org:
As the counting of votes in Arizona, Georgia, and especially Pennsylvania continues, most of the press and punditry have concluded that Vice President Biden has won the 2020 election. Certainly, a substantial majority of the rest of us are suffering from “election fatigue” and eager for this drama to be over. Without disagreeing with the conventional wisdom about the final tally when all the legal votes are counted, I believe the current consensus is missing the fact that Trump has a second, viable stealthy road to victory. I’m reluctantly betting that the debate about who won will continue until at least January 6 when slates of electoral college members are opened in Washington, and most likely beyond that as whatever is decided then is appealed by the loser to the Supreme Court. My conclusion reflects the analysis of my colleague in the Applied History Network at the Belfer Center which is below.
As he notes, this stealthy road follows in the footsteps of a number of previous contested American elections, especially the 1876 election that pitted Tilden v. Hayes. Then as now, each state must decide on a group of electors to meet with a joint session of Congress on January 6 where the winner of the presidential election is declared. The normal practice in a state where Biden won the popular-vote total would be for state election officials to certify the results and send a slate of electors to Congress. But state legislatures have the constitutional authority to conclude that the popular vote has been corrupted and thus send a competing slate of electors on behalf of their state. The 12th Amendment to the Constitution specifies that the “President of the Senate shall, in the presence of the Senate and House of Representatives, open all the certificates and the votes shall then be counted.” That means that in the case of disputes about competing electoral slates, the President of the Senate—Vice President Pence—would appear to have the ultimate authority to decide which to accept and which to reject. Pence would choose Trump. Democrats would appeal to the Supreme Court.