Initially, race was created as a social construct to keep African Americans enslaved. The need for a large agricultural force in the South made the creation of an enslaved class attractive to white plantation owners. Whites justified slavery through various means, including falsely claiming that the enslavement of black people was justified in the Bible. In addition, the biological construct of race operated on the "one-drop rule." This was the idea that a single drop of "black blood" made one black and that the races were biologically separate. Race is a construct, not a biological reality.
However, even after the end of slavery and the end of the Civil War, whites tried to disenfranchise African American people and keep them from voting, owning land, being educated in white schools, and owning businesses by maintaining a strict color line. Blacks were treated differently and unfairly in the eyes of the law, even if their facilities and schools were supposed to be "separate but equal." The legacy of the construct of race is still with us in the United States.