The Black Codes were a set of laws passed in the southern states immediately after the Civil War, aimed at restricting the rights and freedoms of African Americans. They restricted African Americans' ability to vote, hold office, and work in certain occupations. The Black Codes also allowed for the arrest and forced labor of African Americans for minor offenses.
The Black Codes were eventually struck down by the federal government, but they foreshadowed the rise of segregation and discrimination against African Americans in the Jim Crow era. Plessy v. Ferguson, a Supreme Court case in 1896, upheld the constitutionality of "separate but equal" laws, which allowed for the segregation of public facilities. This decision provided legal justification for the continued oppression of African Americans and contributed to the widespread implementation of Jim Crow laws across the South.
Thus, the Black Codes can be seen as a precursor to the more widespread and entrenched system of segregation and discrimination that developed in the Jim Crow era, and the Plessy v. Ferguson decision played a significant role in entrenching these discriminatory practices in law.