After the Civil War, many whites in the South were anxious to ensure that the outcome of the war did not affect the racial, social, and economic order of the region. President Andrew Johnson agreed, and initiated a very lenient program of Reconstruction that did almost nothing to protect the rights or promote the economic well-being of the freed African-Americnas in the South, and indeed restored many former high-ranking Confederates to political office. This infuriated many Republicans in Congress, and after he vetoed several important pieces of Reconstruction legislation, they seized control of Reconstruction, determined to institute a new order in the South based on the equality of African-Americans.
What followed was Congressional Reconstruction, which gave full political rights to blacks, instituted a few economic reform efforts, and actually resulted in some black political leaders getting elected to local, state and even federal offices. The basic economic order was not changed, though. Most African-Americans continued to work on farms, only now they did it as sharecroppers or tenant farmers instead of as slaves. In addition, whites determined to reassert the racial political order used terror, political slights of hand, and other methods to disenfranchise blacks and sympathetic whites and seize control of southern state governments.
By the late 1870s, the entire nation had lost the political will to maintain the project of Reconstruction, and came to value regional reconciliation over full emancipation and equality for Southern African-Americans. In other words, they sought political order, and were willing to tolerate a racial order in the South that placed whites in positions of power. Reconstruction ended in 1877, the product of a political compromise that saw Rutherford B. Hayes in the White House and the Democratic Party firmly back in control of the former Confederate states.