
In the 1930s, although 50% of the population of Southern towns were black, they had no vote and could not marry whites. The policy of segregation meant that blacks had to have their own schools, their own churches, their own football teams, even their own cemeteries.
In the novel, Scout and Jem get into trouble with Aunt Alexandra for attending the blacks' church. The blacks file into the courthouse after the whites and have to sit up in the balcony, away from the whites.

Ku Klux Klan vigilantes
Some whites formed vigilante groups to intimidate and even murder blacks; and right up until the 1950s it was common for black men to be accused of assaulting white women on the basis of little or no evidence. Harper Lee may have based her novel in part on a case in Scottsboro, Alabama.
The Scottsboro case