In the aftermath of the Civil War and the 13th and 14th Amendments, southern states passed laws attempting to create disadvantages for blacks, restrict their rights and keep them separate from whites. Homer Plessy had one-eighth black ancestry, and his light skin allowed him to frequently ride in the white sections of trains, even though Louisiana had laws establishing separate facilities for blacks. He had been selected by the Citizens' Committee to Test the Constitutionality of the Separate Car Law specifically for that purpose -- the intent was to carry the case to the Supreme Court in hopes that it would strike down the law. Plessy sat in the white section of a train, announced his ancestry, and then refused to move to the black section. He was arrested.
The argument against Louisiana's "separate facilities" laws (and those of other states) was that they violated the 14th Amendment, the separation indicating an institutional belief that blacks were inferior to whites. The Supreme Court didn't believe that the laws were a constitutional violation, ruling against Plessy in a 7-1 ruling (Justice David Josiah Brewer's daughter had recently died, so he wasn't in Washington to hear the case).
This ruling entrenched the legal doctrine of "separate but equal" in U.S. law for more than 50 years. While in Plessy's specific case, the black train was in fact of equal quality to the white train, this was the exception. During the "separate but equal" years, black facilities were underfunded, poorly maintained and generally anything but equal.
In 1954, Brown v. Board of Education overturned Plessy, finding that "separate but equal" was invalid and banning racial segregation. Southern states didn't give in easily, and the threat of military force was necessary in some instances to enforce desegregation.