Max pain is the strike at which the largest quantity of NIFTY options would expire worthless, so option buyers as a group lose the most and writers pay out the least. It is worked out from the NSE NIFTY option chain: for every candidate settlement price you total the intrinsic value owed on all in-the-money calls and puts weighted by their open interest, and the strike where that total is smallest is the max pain strike.
NIFTY is the NSE benchmark of 50 large-cap stocks and carries the deepest option liquidity in India, so its chain is usually the cleanest place to read positioning. The level moves as open interest shifts during the day, and it is a tendency rather than a rule — a strong trend, an event or a news shock will override it. It is most useful close to expiry and read together with the NIFTY open interest and Put Call Ratio, both linked above.