Gold has had a great appreciation in value in the past decade. If you have gold jewelry on hand or even broken gold-plated watches or jewelry, they can be sent to a gold refiner for evaluation and refining. Gold-plated products are not worth as much but still offer the ability to make money from a otherwise worthless junk product.
When you sell them your scrap gold they assay it, to find out exactly what percentages of what metals you provided them. They may charge you for that "service."
So there's profit #1.
Then they use acids to dissolve some metals and not others to purify the valuable metals. Suppose you sold them some 14K gold scrap. You actually sold them a metal alloy of 58% gold, 20-25% silver, and 12-7% copper by weight. Proportions vary by different alloys, but the Karat of gold is always a fraction of 24. 24K is 99.9% pure and 12K is 50% pure.
Anyway, they would pay for the gold, at less than 58% what gold traded for on the day they receive your shipment because the gold you sent was scrap, therefore of a lesser value because it needs to be processed (by them) to be of pure value again.
That's profit #2 and #3.
They pay a devalued rate for scrap, and in case you missed it, both silver and copper have a value, and are traded as commodities, but the refinery probably won't pay you for the other metals in the alloy. Though it may not be as big a number as the gold, they deal in volume and the little numbers add up.
By the very process of removing the impurities they increase the value of the metal, and that is the main way they make their profit. Used metal has less value as pure, unless it has historical or sentimental value.
If a refinery has purified an alloy into it's purest state, the metal is in a more rare state. The laws of supply and demand follow. Since refineries are the main source of pure metal, they stand to make the first, and most, profit from the refining process.