Supply and demand. Here's what Wikipedia says it is: "Supply and demand is a... model of price determination in a market. It postulates that in a competitive market, the unit price for a particular good... will vary until it settles at a point where the quantity demanded (at the current price) will equal the quantity supplied (at the current price), resulting in an economic equilibrium for price and quantity transacted."
We investors can spend a lifetime arguing about fundamentals and valuations but finally, the numbers on the screen get determined by the balance of supply and demand at the current price. If there's too much demand, then the price keeps going up till the two match. Stock markets are a perfect laboratory in which to study these phenomena, except the starting point is often not supply or demand but money supply. In the economy on the whole, if the supply of money increases without a commensurate rise in the supply of goods and services, then prices rise. That's actually the real definition of inflation.
The everyday meaning of inflation has now changed to include all price rise. However, what's happening in the Indian stock market nowadays is that classical definition of inflation. There's a huge flow of money coming into the markets. This money has to be deployed to buy stocks. This demand for stocks can only be satisfied at higher prices because existing owners of those stocks will only sell at higher prices.
If you were a punter on the markets, then this is all you would need to be happy. Buy hot stocks, sell in a few hours or days or weeks and enjoy yourself. That is, until the music stops and you find yourself holding unsellable scrips whose prices are collapsing. It's happened many times earlier and no doubt will happen many times in the future, too.
However, since you are not a punter, you will notice that in the entire explanation above, there is no role played by the fundamentals and valuations of the stocks whose prices are going up. Money flows in and prices get inflated. Whether those prices are justified or not, they will be carried up in the rising flood of cash.
As it happens, the price rise is not justified, at least not at this point of time. The current P/E of the Nifty is 25.2 and that of the Sensex is 23.5. Mid-cap indices are also at 32.0 to 30.3. From the perspective of the investor, the P/Es of good stocks are even more eye-watering. Asian Paints is at 56; HUL, at 54; and Pidilite, at 48. Among mid caps, the situation is even more ridiculous. United Breweries is at 95; Page Industries, at 70; and Blue Dart, at 76. Is there any justification for buying stocks at this time?
The answer is not an unequivocal no. Valuations are high, but buying equity is a always about belief in the future. At this point in time, Indian corporates are mostly marking time, unable to march forward. Profits are not growing, and there is no upturn that is immediately visible. Even so, the top-level basics of the economy are in a better shape than they have been for a long time. Numbers like fiscal deficit and inflation as well as many other variables are getting there. There's a long list of problems but looking back over the last few years, there is a clear path to solving them.
At the end of the day, all stock investing is an act of optimism but not blind optimism. At this point of time, the most important thing for investors is to have a long-term perspective and to ensure quality in their investment choices. Either way, whether the markets actually turn out to be overpriced or not, that's the way to earn returns and yet be safe.