I relay the following explanation, which I gave to an anonymous friend who believed that the free market fosters racism, and could not understand why he was wrong.
Okay, I will explain, with a preface. Your hypothetical situation, in which many employers are racists, assumes that free people are, in large part, naturally racist and averse to being near people of other races. It assumes that employers much prefer white employees to black ones. If this is true (a big if), the market will tend to eliminate their racist natures. Simply, here’s how (and remember that this situation is based on your racist assumptions, which may or may not be accurate):
All other factors being equal, demand for a white employee is much higher than demand for a black employee. Therefore whites tend to be employed at a high wage, and blacks tend to be employed at a much lower wage, if at all. In this context–which in its results resembles reality–imagine two manufacturers that produce the exact same product, one of which hires based on racial preference.
The racist employer hires an all-white workforce, and pays his employees the going wage for white labor. The profit-seeking employer hires the cheapest labor, and therefore ends up with an all-black workforce. Labor costs are much higher for the employer who employs only whites. This means the price of his product must also be much higher than the price of the profit-seeking employer’s identical product. Consumers will therefore buy from the profit-seeker, with whom the racist cannot compete. The racist manufacturer will fail, leaving all of his white employees unemployed. This unemployment, which must happen many times over if racist employment is prevalent in society, cheapens white labor, and in short order the price of labor is determined by the price or quality of labor–not by skin color. In this way, the price mechanism, the market, and the profit incentive eliminate racist business practices.