In To Kill a Mockingbird, Bob Ewell attacks Scout and Jem out of revenge and humiliation after Tom Robinson’s trial.
After Atticus defends Tom Robinson, he exposes that Bob Ewell is lying and is likely the one who beat Mayella. Even though Ewell technically wins the case, he is publicly embarrassed because Atticus makes him look foolish in court. This humiliation festers into anger, and Ewell begins harassing others connected to the case, including spitting in Atticus’s face and threatening people around town.
Ewell’s attack on the children is the climax of this revenge. He specifically targets Scout and Jem because they are Atticus’s children and therefore an extension of the man who exposed him. On Halloween night, he ambushes them in the dark and tries to kill them, an act that shows how far his resentment and cruelty have escalated.
Ewell is motivated by wounded pride and hatred. Being revealed as abusive and dishonest strips him of the little social standing he had, and instead of accepting that, he lashes out violently at the most vulnerable targets available. In this sense, the attack highlights a broader pattern in the novel of prejudice and pride leading to real violence against innocent people. Bob Ewell’s actions are the extreme outcome of the same hatred that convicted Tom Robinson.