Proverbs 25:4–5 (ESV)

4 Take away the dross from the silver, and the smith has material for a vessel;

One can think here first of all of the influence of bad advisors. King Rehoboam lost the greater part of his kingdom because of them (1 Kings 12:1–33). But also, do not forget the influence of false prophecy. Many kings in the Bible lost their thrones because they were misguided by wicked people who pretended to be prophets. Think of Ahab (1 Kings 22:1–53) and of the kings in the time of Jeremiah (Jeremiah 20:1–18; Jeremiah 23:9–32; Jeremiah 28:1–17).

Solomon acted wisely when, as soon as he became king, he removed harmful influences from office (1 Kings 2:1–46). Jehoshaphat and Joash also surrounded themselves with godly influences, who helped them to rule with justice (2 Chronicles 17:1–19; 2 Chronicles 20:1–37; 2 Chronicles 24:1–27). See also David’s sketch of the righteous king in Psalm 101:4–7.

See also Proverbs 16:12, Proverbs 20:26, Proverbs 20:28, and Proverbs 29:14.