Answer:
Black Codes were created after the end of the Civil War to limit the freedoms granted to former enslaved persons.
Explanation:
When the Civil War ended, the Southern States were subject to the authority of the Union Army, migrants arrived from the North and southern supporters of the Union. While a first effort was to eliminate the supporters of the Confederation from public office, the feeling in favor of racial discrimination was still active in the South and the triumph of the North was not enough to suppress it.
When the requirements for the former Confederate States to return to the Union were discussed during the Reconstruction period, all state assemblies accepted the Thirteenth Amendment of the Constitution repudiating slavery. The Black Codes served in practice as a method to legalize racial discrimination and especially the segregation practiced by the white authorities.
Nevertheless, the state assemblies were concerned with reducing the political influence of the black population and for this the Black Codes were established as norms to control the work, activities, and displacements of the former slaves, establishing even the bondage for debts. The first southern state to adopt such norms was Texas in 1866, and was promptly imitated by other southern states, where it was considered necessary to control the freedom of work of the former slaves through a system of fines and corporal punishment, as a way to ensure the hand of cheap work to whites.
Subsequently, the Black Codes expanded their scope to include issues such as the right to suffrage, the use of public facilities, school instruction, and many other issues that were matters of even racist laws, known under the generic name of Jim Crow Laws.