After graduating from Kenyon College in 1832, Davis earned a law degree from Yale in 1835. He was admitted to the Illinois bar the same year and in 1836 established a practice in Bloomington. Always politically ambitious, Davis was elected to the Illinois legislature in 1844 on the Whig ticket. He attended the state constitutional convention of 1847 and the following year began a 14-year career as a circuit judge. It was as a judge that Davis became a close friend of Abraham Lincoln.

At the Republican convention of 1860 and in the presidential campaign that followed, Davis worked assiduously for Lincoln’s nomination and election. In February 1861 he accompanied the president-elect to Washington, D.C., and served as an adviser until Lincoln appointed him to the Supreme Court in 1862. Davis was never a supporter of the more extreme antislavery wing of the Republican Party, and he angered much of the party with his majority opinion in the Ex parte Milligan case of 1866.

While still a justice, Davis in 1872 accepted the presidential nomination of the Labor Reform Convention as a stepping-stone to securing the nomination of the Liberal Republican Party. When the party instead nominated Horace Greeley, Davis withdrew as the Labor candidate. He then drifted closer to the Democrats, who expected him to cast the decisive vote for Samuel J. Tilden on the Electoral Commission of 1877. But Davis disqualified himself from the commission when he resigned from the Supreme Court in 1877 to accept election by the Illinois legislature to the U.S. Senate. He served one term in the Senate, the last two years as president pro tem. Upon his retirement in 1883, Davis returned to Bloomington.