Short answer: Jem understands that in the white community a person's family name and social position bear significance. Thus, there is discrimination among the white residents in Maycomb.
In Chapter 23 Scout considers inviting Walter Cunningham to have "dinner" [ Some Southerners call the noon meal dinner, a carryover from the British Isles of their origins.], and she even suggests that he could visit after school. "Atticus could drive him back to Old Sarum. Maybe he could spend the night with us sometime, okay, Jem?"
Aunt Alexandra overhears Scout, "We'll see about that," she interjects, threateningly. The ingenuous Scout asks, "Why not, Aunty? They're good folks." Peering over her glasses at Scout, Aunt Alexandra clarifies that she does not doubt that the Cunninghams are decent people; however "they're not our kind of folks." When Scout demurs, her aunt clarifies her response. She explains that one can scrub Walter, but he will never be like Jem. "Besides, there's a drinking streak in that family a mile wide. Finch women aren't interested in that sort of people."
After Scout counters that if Walter's family is "good folks," "why can't I be nice to Walter?" Alexandra explains that Walter is no relative of theirs, nor is he in the same class: "Because--he--is--trash....I'll not have you around him, picking up his habits and learning Lord-knows-what...."
Later, Jem explains to Scout, who still fumes over her aunt's calling Walter "trash" when he is not at all like the Ewells. Jem informs his sister that their aunt is trying to make her a lady; he adds that he now has the caste system in Maycomb figured out,
"There are four kinds of folks in the world. There's the ordinary kind like us and the neighbors, there's the kind like the Cunninghams out in the woods, the kind like the Ewells down at the dump, and the Negroes."
Jem has deduced this from observation.
"...our kind...don't like the Cunninghams, the Cunninghams don't like the Ewels, and the Ewells hate and despise the colored folks."
Jem has arrived at an insight into humanity: people always want to feel superior to others. Bias exists within races as well as among them; rather than being racial, they are social or economic.