Under the Constitution, government officials are not supposed to sort people by race, for any public benefit. If they do, they have to come up with the strongest policy reasons, and even those will be severely tested in court. The really hard part comes when race is taken into account as an attempt to remedy past racial discrimination. When does that become a new form of discrimination? Courts have long struggled with that remedy issue, and in no field of law has that effort been more difficult than in drawing new election districts, as almost always has to be done after each new federal Census. Populations do shift over 10-year spans, and districting maps thus may get out of date. Racial calculations do enter into the map-drawing process, for the simple reason that federal voting rights law requires it.
In a state where voting tends to occur along racial lines (whites tend to vote together, minorities tend to vote together), minorities may always be outvoted if election arrangements are made on a completely color-blind basis. So, federal voting rights law insists that, when voting ordinarily follows racial lines, arrangements have to be made to give minority voters a chance to choose representatives whom they prefer and who will take their interests into account.
The result is the creation, intentionally, of what are somewhat clumsily called “majority-minority districts” – that is, election districts in which a racial minority has enough power in numbers to control or nearly control election outcomes. As a result of the creation of such districts, the number of minorities getting elected to public office, especially to state legislatures, has grown markedly in the past half-century.