22 Then David arose, and all the people who were with him, and they crossed the Jordan. By daybreak not one was left who had not crossed the Jordan. 23 When Ahithophel saw that his counsel was not followed, he saddled his donkey and went off home to his own city. He set his house in order and hanged himself, and he died and was buried in the tomb of his father. 24 Then David came to Mahanaim. And Absalom crossed the Jordan with all the men of Israel. 25 Now Absalom had set Amasa over the army instead of Joab. Amasa was the son of a man named Ithra the Ishmaelite,[1] who had married Abigal the daughter of Nahash, sister of Zeruiah, Joab's mother. 26 And Israel and Absalom encamped in the land of Gilead. 27 When David came to Mahanaim, Shobi the son of Nahash from Rabbah of the Ammonites, and Machir the son of Ammiel from Lo-debar, and Barzillai the Gileadite from Rogelim, 28 brought beds, basins, and earthen vessels, wheat, barley, flour, parched grain, beans and lentils,[2] 29 honey and curds and sheep and cheese from the herd, for David and the people with him to eat, for they said, "The people are hungry and weary and thirsty in the wilderness."

Matthew Henry's Commentary on 2 Samuel 17:22-29

Commentary on 2 Samuel 17:22-29

(Read 2 Samuel 17:22-29)

Ahithophel hanged himself for vexation that his counsel was not followed. That will break a proud man's heart which will not break a humble man's sleep. He thought himself in danger, concluding, that, because his counsel was not followed, Absalom's cause would fail; and to prevent a possible public execution, he does justice upon himself. Thus the breath is stopped, and the head laid low, from which nothing could be expected but mischief. Absalom chased his father. But observe how God sometimes makes up to his people that comfort from strangers, which they are disappointed of in their own families. Our King needs not our help; but he assures us, that what we do for the least of his brethren, who are sick, poor, and destitute, shall be accepted and recompensed as if done to himself