Answer:
The American Civil War, which took place between 1861 and 1865, and it was born from the constant conflict between North and South on the matter of the righteousness of enslavement of black people. While the South, who enjoyed the benefits of slaves, pushed for slavery to be left untouched, the North wished for abolition to be reached. There were also some who decided that although slavery needed to end, this should only be applied to the states that were currently joining the Union, not the ones that had been a part of it originally.
Of the people who were affected by the Civil War, no minority group was more affected by it than African Americans, as it was due to them, and what Northerners and Southerners thought on the matter of slavery, and black people, that the whole conflict ensued.
Although the War was won by the North, and slaves began to be released from their bondage, this did not mean an immediate relief for African Americans, as in general, in both the North and South, this minority was seen as inferior to white Americans. And many of these African Americans did not reap the rewards, or saw improvements in their conditions until a century later, and it took an uphill battle for them to win certain rights, to not be segregated and to not be considered less than white people.
So, although the Civil War intended to ensure the freedom of slaves, this did not mean that white people, regardless of where they came from, were ready to accept them as equals, or part of their groups. This is why segregation became such a big deal, and it did not stop generating conflict until the Civil Rights movement managed to win its final battle, with the passing of the Civil Rights Act of 1965.