These two verses comprise one wise saying. By way of comparison, the focus here is on the king and those around him.
The comparison involves impurities that appear during the process of smelting silver ore in a furnace. As “the silver” heats up, “the dross” — a mass of all the impurities mixed in with the silver ore — separates and begins to form on the surface of the metal.
The real value of the silver only comes after “the dross” is separated out and removed. At that point, “out comes material for the silversmith” from which he can form an item of beauty and even greater value.
To “remove the wicked from the king’s presence” is understood as a similar process. For the king to be surrounded by people whose motives are impure (“the wicked”) won’t be good for either the king or his kingdom.
In the end, the only way to build anything of lasting value is for it to “be established in righteousness.” And the truth is — “the wicked” and “righteousness” don’t co-exist well!
For any of us to accomplish something of real meaning and purpose, it will be “through righteousness.” That calls for proper motives on our part and — since we won’t be able to do it all by ourselves — being surrounded by others in whom I can also have confidence.
Together we can do some great things — under God!
Otherwise, “the dross” in our own hearts, or hearts of those around us, will keep us from ever becoming and accomplishing the things we believe we were called to do!