Of late we have been hearing a lot about “rigged” elections or contesting the results of the presidential election. Here is some relevant information on this process: the ever-reliable CRS offers Legal Processes for Contesting the Results of a Presidential Election. Other valuable insights can be gleaned from: Electoral College 2016 (National Archives); How Would a Contested Election Work? Five Things to Know (NBC); Contested presidential elections, and why parties try to avoid them (Pew); and Bitter and Contested Elections in America’s History (NPR).
And just so you don’t think that this only occurs in the presidential arena, here are a couple of interesting articles: Partisanship and Contested Election Cases in the House of Representatives, 1789–2002 and Partisanship and Contested Election Cases in the Senate, 1789–2002 (both from Studies in American Political Development).