It is actually Jem who tells Scout about the four different types of people in the world of Maycomb and To Kill a Mockingbird. In Chapter 23, Atticus explains to Jem that it was one of the Cunninghams on the jury who held out for as long as he did before finally giving in and voting Tom Robinson guilty. Jem is amazed to find that this man, who apparently was one of the mob trying to lynch Tom Robinson at the jail, could suddenly turn around and decide to set him free. Atticus explained that you had "to know 'em" first. It was from this talk with Atticus that Jem gained his foresight about different types of people.
"You know something, Scout? I've got it all figured out, now... There's 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."