It's a metaphor that means "Adversity reveals true character".
The phrase highlights how difficult situations or challenges can expose the true nature of a person, an object, or even a situation. Just as fire refines gold by removing impurities, trials and tribulations can reveal the true value and strength of something.