A company who takes the job to remove mine riches would be paid for the work it does. After the company removes the gold, and gets its money for the work it has done, then who would own the gold?
That's a good question. I guess the gold would be owned by whoever buys it. We've had a lot of copper mining in my state, although any gold they mine becomes part of the company's resources. There was a pretty nasty miners' strike back in the 1980s. The companies owned the mines (and in some cases, even the entire towns where the mines are located), but things hit a downturn when the price of copper decreased. The companies started tightening up.
I knew this one family where their father had worked in the mines for many years, was getting close to retirement, and they fired him, but told him he could reapply as a new employee, while losing all his years of seniority and retirement benefits. The companies did pretty crappy things to their workers, who were the ones doing the actual work of mining and extracting the copper from the ground.
So, who gets the resources? The workers who actually do the work, or the mine owners who do no work, yet simply hold a piece of paper that says "we own the mines"? That's where it gets a bit dicey in some people's interpretations of "freedom" and "fairness."
Family is important, but, a family who lives in a poor country, would not have enough money for proper education of their children, and even there may not be good schools in a poor country.
Even poor countries still have a few rich families. It might still be better to be born into a rich family in a developing country than to be born into a poor family in a first world (aka "rich") country.
I agree it's still worse to be poor in a poor country than it is to be poor in a rich country, but the way that you put it, it was like you were saying that some people are just "lucky" to be born into a rich country. I don't know if that really tells the whole story about how the world got to the point that we're at now - at least in terms of resources, rich countries, poor countries, and how such a disparity came about in the first place.