Thomas Sowell fills out the important history  behind Jim Crow legislation – the history that made racial segregation in the U.S. a reality. Here’s the core of Sowell’s explanation:
Those who see government as the solution to social problems may be surprised to learn it was government that created this problem. Many, if not most, municipal transit systems were privately owned in the 19th century and the private owners of these systems had no incentive to segregate the races.
These owners may have been racists themselves but they were in business to make a profit — and you don’t make a profit by alienating a lot of your customers. There was not enough market demand for Jim Crow seating on municipal transit to bring it about.
It was politics that segregated the races because the incentives of the political process are different from the incentives of the economic process. Both blacks and whites spent money to ride the buses but, after the disenfranchisement of black voters in the late 19th and early 20th century, only whites counted in the political process.
Sowell also hits an important nail on the head with this line near the end of his column:
People who decry the fact that businesses are in business "just to make money" seldom understand the implications of what they are saying. You make money by doing what other people want, not what you want.
Although Sowell doesn’t mention them by name, the scholars who supplied the important research on the roots of racial segregation in the United States are Robert Higgs (see this outstanding book ) and my former colleague at George Mason University Jennifer Roback-Morse. (Her two most important papers along these lines – but for which I cannot find links – are Jennifer Roback, "Southern Labor Law in the Jim Crow Era: Exploitative or Competitive?," University of Chicago Law Review, Vol. 51 (1984); and Jennifer Roback, "The Political Economy of Segregation: The Case of Segregated Streetcars," 46 Journal of Economic History, Vol. 46 (1986).)