Atticus always tried to give his children straight answers to even the toughest questions, but he didn't divulge the entire truth when Scout first asked him in Chapter 9. After Cecil Jacobs told Scout that Atticus "defended niggers," she asked her father if it was true. He told her that all lawyers defended Negroes, but Scout said that Cecil's accusation made it sound like Atticus was "runnin' a still." Atticus told her that he had many reasons for taking Tom's case. In addition to Tom being a friend of Calpurnia's,
I couldn't hold my head up in town, I couldn't represent this county in the legislature, I couldn't even tell you or Jem not to do something again.
When Scout asked if he would win the case, Atticus told her "No, honey." Later in the chapter, however, Scout overhears Atticus talking with his brother Jack, and she hears a slightly different version.
You know, I'd hoped to get through life without a case of this kind, but John Taylor pointed at me and said "You're it."
She discovers that it was Judge Taylor who had directed (asked?) Atticus to take the case.