Proverbs 17:3: "The refining pot is for silver and the furnace for gold, but the Lord tests the heart."
Malachi 3:2b-3: "For He is like a refiner's fire and like fullers' soap. He will sit as a refiner and a purifier of silver; He will purify the sons of Levi, and purge them as gold and silver, that they may offer to the Lord an offering in righteousness."
Have you ever seen a rough nugget of gold fresh out of the rocks and dirt? When I first saw a real gold nugget at one of those places where you "pan for gold" along the road (a tourist trap) I thought, "How can anything so beautiful come out of something so ugly and lumpy and dirty?" One would wonder why people would literally kill to have such precious metals! But then you go to the jewelry store and you see all the gorgeous rings, pins, necklaces, brooches and other priceless items that have been fashioned out of those ugly lumps, and you marvel at the difference! What could have happened to make such a change?