I think, that the answer to why, is that the change in presidencies from republican to democratic (i might be wrong, and it could be democratic to republican) influenced the change slightly because the new party, wanted to focus on different issues such as westward expansion. As to how, it was because the government withdrew all federal troops from the south, so there wasn't anybody to enforce the laws protecting African American rights so the southerners were free to exploit the African Americans to their will.