There is an official answer
India does not leave this to opinion. A standing SEBI committee, the Market Data Advisory Committee, produced a harmonised classification so that exchanges, rating agencies and fund houses would all describe a company the same way.
It has four levels, each narrower than the one above it: Macro-Economic Sector, then Sector, then Industry, then Basic Industry. Every listed company sits at one point in that structure.
A company is placed by what it earns its revenue from, not by what it calls itself. This is the reason the classification is worth checking rather than guessing.
From the widest bucket to the narrowest
Bharat Foods, our illustrative food company, through the four levels.
The four levels answer four different questions. Macro-Economic Sector is the broadest sweep of the economy; Basic Industry is the narrowest description of the work. Two companies can share the top level and differ at the bottom.
Why the level you use changes the answer
Ask 'are these two companies in the same sector?' and the honest reply is: at which level? A bank and a housing finance company can sit apart at Basic Industry and together further up. Both statements are true; they answer different questions.
This is what makes 'I am diversified, I own four different companies' unreliable. If all four share a Macro-Economic Sector, then one thing going wrong for that part of the economy reaches all four at once, however different their names look.
The reverse trap exists too. Two companies that both sell food can sit in different Basic Industries — one packaging groceries, one running restaurants — and behave very differently even though a headline would group them.
You own a bank, a housing finance company and an insurer, and describe yourself as diversified across three businesses. What is the weakness in that claim?
What the classification is for
It is the reason a sectoral index can exist at all, and the reason a fund can promise to hold a particular kind of company and be held to it. Without one agreed structure, every party would draw its own boundaries and no promise could be checked.
It also changes. A company that shifts where its revenue comes from can be reclassified, and the framework itself is revised as the economy changes. The number of categories at each level is not fixed for ever, so read the current list rather than a remembered figure.
For you the practical use is small and real: before assuming two holdings are unrelated, look them up. It takes a minute and it is checkable, which is more than most claims about diversification manage.
Companies sorted by size, and sorted by what they do. An index takes a slice of that sorted universe and turns it into a single number — and the way it does the arithmetic is not the obvious way.