The force of demand and supply determines the price and quantity of goods and services which are offered for sale in a market. If demand is higher than supply then price of the product is high. Also, if demand is lower than the supply then the product is sold at a lower rate.
The key points here are that satisfaction of the society should be maximized at minimum cost; also all resources should be fully utilized to achieve this.
For example: Imagine that two producers of detergents are in competition (Tide by P&G and Active wheel by HUL). If consumers swing away from Tide to Active Wheel, demand falls for the Tide and rises for Active Wheel. In response to falling demand, P&G will lower the prices, whereas HUL will increase the prices in response to rising demand. The consumers react to this increase in price by shifting from Active Wheel to Tide. To tackle this HUL will also lower the price and thus at some point the demand for both the products will return to the original level and also their prices will be similar to achieve equilibrium.