A medium of exchange, also called money, is a good that is demanded not for consumption or production, but solely for the purpose of future exchange against another good. A good can only qualify as a medium of exchange if virtually every individual within a certain territory accepts it in exchange for other goods.
A medium of exchange does not appear immediately. It only becomes necessary as more humans enter the market and exchange transactions under division of labor substitute autarky. Out of existing consumer goods, those that are most durable, uniform, divisible, fungible, and reasonably scarce prevail as the best ones. It is a historical fact that the precious metals gold and silver prevailed as the best media of exchange in a market based on voluntary action.
Actors in the market will arrange media of exchange on their value preference scale, based on their assessment as to what other goods they can obtain with them and where those are located on this same scale.