At the end of Chapter 28, Sheriff Tate has discovered the body of Bob Ewell
"... lyin' on the ground under that tree down yonder with a kitchen knife stuck up under his ribs."
He is not sure at that moment how Bob has died. After Scout tells her story, her father comes to the very un-Atticus-like assumption that it is Jem who has stabbed Bob. Sheriff Tate finally convinces Atticus that there is no way
"... any boy Jem's size with a busted arm had enough fight in him to tackle and kill a grown in the pitch dark."
Once Boo Radley steps from the darkness of the corner in Jem's room, Sheriff Tate realizes what must have happened, even if the befuddled Atticus does not. It was not Jem who had stabbed Bob, but Boo. Tate is faced with a moral dilemma: to face the truth and investigate the murder properly, which would force Boo to publicly testify; or come up with another story. Although Boo would probably have been cleared since it was a case of self-defense, the recent verdict against the innocent Tom Robinson probably made Tate realize that Boo might suffer the same fate as Tom. So, the sheriff decids to call Bob's death a self-inflicted wound.
"Bob Ewell fell on his knife. He killed himself."
Tate claims that the second knife--the switchblade he was waving--was taken off a "drunk man", earlier in the evening. The switchblade probably belonged to Boo (or possibly Bob).
"There's a black boy dead for no reason, and the man responsible for it's dead. Let the dead bury the dead this time, Mr. Finch...
"To my way of thinkin', Mr. Finch, taking the one man who's done you and this town a great service an' draggin' him with his shy ways into the limelight--to me, that's a sin... If it was any other man, it'd be different. But not this man, Mr. Finch...
"I may not be much, but I'm still sheriff of Maycomb County, and Bob Ewell fell on his knife."