In a market economy, resources are distributed based on the profitable interactions between producers and consumers. These interactions obey the fundamental law in economics, which is the law of supply and demand.
A market economy works without government interference. Producers are free to manufacture the amount of goods demanded by the consumers. If demand for a particular commodity or service escalates, the suppliers can raise their prices to generate profits. However, due to the increased prices, the purchasing power of some buyers diminish, which forces them to sell their goods at a more affordable price. This dynamic between producers and consumers makes a market economy thrive.