In a market economy resources are allocated across different lines of production according to their profitability. As resources move toward more profitable lines, production increases and the greater supply lowers their prices. As resources move away from less profitable lines, production declines and the smaller supply raises their prices. The array of prices of all goods in market economy reflects this efficient allocation of resources. The price of each good reflects the least valuable use of a unit of it given its efficient production and consequent supply.
For example, a person suffering a migraine headache will not have to pay all the money he owns to have it relieved. The price of relief will reflect the drug’s (or whatever service is rendered for its relief) marginal utility, i.e., the least-valuable use of the drug to all migraine sufferers. In the same way, a man dying of thirst does not have to pay all the money he owns to buy a bottle of water at Wal-Mart. He pays the same price as everyone else, a price which results from the efficient production of bottled water. The consequent enormous supply means that a bottle of water has a reasonable price.
The genius of the market economy is not that it keeps prices low to benefit consumers or keeps them high to benefit producers, but that it allocates the efficient amount of resources for society at large into each line of production, including “necessary” and well as “unnecessary” lines.