31 Then someone told David, saying, "Ahithophel is among the conspirators with Absalom." And David said, "O Lord, I pray, turn the counsel of Ahithophel into foolishness!" 32 Now it happened when David had come to the top of the mountain, where he worshiped God--there was Hushai the Archite coming to meet him with his robe torn and dust on his head. 33 David said to him, "If you go on with me, then you will become a burden to me. 34 But if you return to the city, and say to Absalom, 'I will be your servant, O king; as I was your father's servant previously, so I will now also be your servant,' then you may defeat the counsel of Ahithophel for me. 35 And do you not have Zadok and Abiathar the priests with you there? Therefore it will be that whatever you hear from the king's house, you shall tell to Zadok and Abiathar the priests. 36 Indeed they have there with them their two sons, Ahimaaz, Zadok's son, and Jonathan, Abiathar's son; and by them you shall send me everything you hear." 37 So Hushai, David's friend, went into the city. And Absalom came into Jerusalem.

Matthew Henry's Commentary on 2 Samuel 15:31-37

Commentary on 2 Samuel 15:31-37

(Read 2 Samuel 15:31-37)

David prays not against Ahithophel's person, but against his counsel. He prayed this, in firm belief that God has all hearts in his hand, and tongues also. But we must second our prayers with endeavours, and David did so, else we tempt God. But we do not find wisdom and simplicity so united in any mere man, that we can perceive nothing which needs forgiveness. Yet, when the Son of David was treated with all possible treachery and cruelty, his wisdom, meekness, candour, and patience, were perfect. Him let us follow, cleave to, and serve, in life and in death.