In the past, freed slaves fled the north, and segregation laws were implemented to restrict them and keep them in the same areas. A lot of white people left neighborhoods that black people started to move into. Politicians invested in white only schools and neighborhoods.
Today, facebook allows advertisers to filter out people of certain races, immigrants, and people with disabilities. White flight still occurs today