Supply is the amount of goods and services available. Demand is the amount of goods or services that people want. In a free competitive market, supply and demand find an optimum balance and an optimum price for each good or service. (Goods or services are here after called 'widgets' for the sake of brevity).
When there are fewer widgets than people want, some people will pay more to get the ones available. The price rises. As the price rises, it becomes more attractive for other businesses to produce widgets and the supply increases.
When there are more widgets produced than there are people willing to pay for them at a given price, the price will drop making widgets attractive to more people.
If too much supply enters the market, the price can fall below the cost of providing widgets and some producers will go out of businesses. This reduces the supply causing the price to rise again.
There are certain things for which there is a constant demand, like food. When less food is available than people need, they will pay anything they can to get a next meal. For other things, there is a limit to what people will pay before they simply choose to do without.Problems
This balancing magic of the free market process does not work when one producer or a collaboration of producers maintain a monopoly control over a particular widget. Without active competition, the producer, or producers operating in collaboration, can charge any price and we must pay if we want their product.
Long-term concerns
The sensitivity of markets is limited to the near future. There is no automatic mechanism for taking into account long-term factors like diminishing resource supplies, pollution or the impact of actions on people and communities. See Economics is 3/5 ths of Ecology.