Question: why did ahithophel hang himself?
Answer: Alexander Kirkpatrick, in the Cambridge Bible for Schools and Colleges, calls his suicide "the first deliberate suicide on record". Ahithophel's betrayal of David, and subsequent suicide are seen as anticipating Judas' betrayal of Jesus, and the gospels' account of Judas hanging himself (Matthew 27:5).