American form of slavery was enforced under slave codes.
The 13th Amendment abolishing slavery was passed in 1865.
Those desiring to maintain superiority to and power over freed slaves and blacks in general created the black codes in response to the 13th Amendment.
The 1865-1877 Reconstruction policies/laws were created in response to the black codes.
This includes the 14th amendment (1868) that granted citizenship and legal rights to slaves freed under 13th Amendment.
The 15th Amendment (1870) granted voting rights regardless of race to further clarify rights of blacks and all Americans. However, it did not ensure voting rights for women. The 19th Amendment of 1920 accomplished that.
Yet, those desiring to maintain superiority to and power over freed slaves and blacks in general did not give up.
In response to Reconstruction, they created the Jim Crow laws of 1877-1954 further establishing black codes designed to restrict/deny voting rights and create a separate but equal society.
References:
Legal History of 14th Amendment
Southern Black Codes (Brown vs Board of Education)
Black Codes (Ferris State University)
Ida B. Wells the Black Female Journalist