I worked in a court setting for 30 years. At the beginning of my career, most defendants were white, older and had committed white-collar crimes. But as my career unfolded, in the late 90s and into this century, defendants were much younger, some barely 20, more BIPOC, and the crimes with which they were charged centered around drug sales and gang activity stemming from it. What changed? I believe it was the collapse of the steel industry and other types of manufacturing. One could no longer walk out of high school and into the mill for a job which lasted through to retirement. As mills pared down and plants which supported them were shuttered, there were less taxes paid to local communities, so urban schools received less funding. With less disposable income and the advent of the mall, downtowns suffered. White flighters moved to the safe suburbs and sent their kids to college. Those left had little to no opportunity and as their communities crumbled, they were deemed dangerous and ended up in prison as young people, traveling the school to prison pipeline. Instead of a job, what awaited them was a cell. This kept them under control, so they were no longer a threat to the white community. Rather than spend funds on education, vocational training, etc., governments built prisons, to solve the problem of these "dangerous" people potentially showing up in the suburbs.
Another factor was crack cocaine, which was the drug of the inner city, while powder cocaine was the suburban choice. Penalties for offenses involving crack were much more strict, thereby affecting the mostly black defendants from the inner city in the form of much longer sentences. untila case mad it to the Supreme Court, which agreed the portion of the Sentencing Guidelines relating to crack cocaine were indeed racist. Sentences were reduced, which sometimes resulted in immediate release.
I could share many examples of the systemic racism built into the justice system.