“And Absalom and all the men of Israel said, The counsel of Hushai the Archite is better than the counsel of Ahithophel. For the LORD had appointed to defeat the good counsel of Ahithophel, to the intent that the LORD might bring evil upon Absalom.”
King James Version (KJV)
Matthew Henry's Concise Commentary
17:1-21 Here was a wonderful effect of Divine Providence blinding Absalom's mind and influencing his heart, that he could not rest in Ahithophel's counsel, and that he should desire Hushai's advice. But there is no contending with that God who can arm a man against himself, and destroy him by his own mistakes and passions. Ahithophel's former counsel was followed, for God intended to correct David; but his latter counsel was not followed, for God meant not to destroy him. He can overrule all counsels. Whatever wisdom or help any man employs or affords, the success is from God alone, who will not let his people perish.
“And the King shall answer and say unto them, Verily I say unto you, Inasmuch as ye have done it unto one of the least of these my brethren, ye have done it unto me.”