The beauty, scarcity, unique density of gold (no other metal outside the platinum group is so heavy) and the ease with which it could melt, form and be measured made it a natural trading medium. Gold is much more valuable than any other metal, which means it will always have a use for it. Metal is so popular because it doesn't rust or tarnish and its color never fades. That's why gold is likely to remain valuable, no matter what happens in the market.
Once you've linked your currencies to gold and silver, your economy will be at the mercy of the quantity of them available in your area. It's tough and rare enough to be used as a marker of value, but there's only a limited amount of gold that humanity can practically access on Earth. The limited amount of supply, unlike fiat currencies controlled by central banks, which can print more money as needed, has made gold considered a good hedge against inflation. This was known as the gold standard and, although governments abandoned it in the 1970s, central banks continue to accumulate large quantities of gold, amounting to about 35,000 tons, or approximately one-fifth of the amount of gold that has been mined.
From an elementary perspective, gold is the most logical option as a medium of exchange for goods and services. It is difficult to know the exact number of silver and gold, but there is no significant difference between their relative quantities. The investment argument for gold is based on its lack of correlation with other asset classes and on its proven ability to maintain its value for centuries. It had so much gold in relation to goods and services in its economy that it was no longer really scarce.
For example, you can buy physical gold, buy gold shares in gold mines, or even buy shares in an ETF (exchange-traded fund) that tracks the price of gold. The rarity, beauty and malleability of gold led to its use as currency and jewelry in many different cultures. In addition, gold continued to be appreciated by cultures throughout history, including those that settled in Central and South America and created great civilizations such as the Aztecs, Mayas, Toltecs and Incas. Nowadays, although its properties have not changed and there is more gold than ever, it is simply too restrictive; economies are fast and dynamic, with massive productions and impressive technical possibilities.
For many decades, many of the world's currencies were backed by gold, and central banks required an equivalent amount of gold for every dollar or other currency in circulation. Gold prevailed because it had just the right amount of each of these traits to make it an attractive option. It has been mined throughout history, and gold production peaked in the late 19th century before falling significantly after World War II. This means that when you see countries such as Ecuador, China or Russia buying large quantities of gold, they invest in gold as part of the return on their portfolio, just like any other type of investment.