In Economics we study the idea of 'scarcity' (also known as the Economic Problem). Scarcity means that there is a finite amount of resources and an infinite amount of wishes. The Price Mechanism exists to allocate the scarce resources amongst the competing uses.
There are three functions of the Price Mechanism. Firstly, it acts as a signalling function, demonstrating when there are surpluses and scarcities through price increases and decreases. Secondly, it acts to transmit the preferences of the consumer to the producers, as it shows where the demand is. Thirdly, it acts as a rationing function, meaning that if there is a shortage of the resource or product supply contracts causing the price to increase, leading the demand to equate to the supply once again.