The circumstances around Bob Ewell's death seem a little bit mysterious. Bob was likely drunk when he attacked Jem and Scout while they were walking home from school after the evening pageant event; after the confusion of the attack in the dark, Jem ended up with an injured arm, and Bob Ewell ended up with a knife in his chest.
Heck Tate asserts Boo Radley saved the children from more serious harm when he stabbed Bob Ewell with a knife and killed him. Another reading of the situation suggests that Bob Ewell fell on his own knife when he was attempting to hurt Jem. At first, Atticus even believes that Jem stabbed Bob in self-defense, and he is such an upstanding man of the law that he discourages Heck Tate from trying to protect Jem from the consequences of such an action. The widely accepted version points towards Boo Radley as Bob Ewell's killer and the savior of the Finch children.