What are the main factors that contributed to the rise of segregation in the United States during the 19th and 20th centuries?