Gold is accepted by virtually anyone in society as having inherent value, and it is very easy to use - there is a lot of value in a very small amount of it. Same goes for silver, if carrying around gold is like carrying around hundred dollar bills, carrying around silver is like carrying around tenners.
In a world of high specialization, barter deals are not only impractical, they are quite frankly impossible, as most of the times a collective of people produces a single good. Imagine a blacksmith that produces a pitchfork. The farmer needs a pitchfork, so he offers the blacksmith one sheep. But the blacksmith doesn’t want a sheep, he wants some meat, some potatoes, some tomatoes, and be able to get some iron ore. So now he’d have to exchange the pitchfork for the sheep, kill the sheep, go to the market, and offer pieces of sheep for sale to the potato farmer. But the potato farmer doesn’t eat sheep meat, he wants cow meat, so he exchanges some potatoes for some sheep meat, and then tries to exchange the sheep meat he doesn’t need with the guy who sells cows. But the guy who sells cows doesn’t want sheep meat. Imagine the problems in trying to exchange goods with all the people of interest.
The people of the bronze age found this impractical, and hence, we now have currency. Currency was composed of the most precious of all minerals - gold and silver (and occasionally some others). All currency was “worth its weight in gold”. So now the farmer could sell his sheep meat in the market to whoever wanted sheep meat, then take the gold/silver coins he earnt and buy his pitchfork. The blacksmith could then use that gold to buy some ore for the next tool he’ll make, and go to the market to buy all the food he wanted. A bazzillion problems were solved. The price of gold is whatever the people doing the deal agree the price of gold is.
For us living in the space age, currency would be a necessity, unless several billion people die. The planet just cannot support a nonspecializing population that is required for barter deals to be effective. The chances of this happening are minuscule, we’d need a nuclear war to unwind the world that far.
If there is a major crash that leads to world currencies collapsing, precious metals will, without a shadow of doubt, become the actual currency until confidence in paper is restored.