Dividends are declared by companies from the net profits of the company. Now, many companies that make profits do not necessarily declare a dividend. There maybe various reasons for that.
So, the simple answer to the question on what basis companies declare dividends would be their own internals.
For example, in this quarter Infosys had a dividend distribution ratio of more than 50 per cent. What this means is that more than 50 per cent of the net profits was distributed as dividends.
Now, for a company like Infosys it is easy to declare large amounts from its net profits as dividend. This is because this is a debt free company and even if wants money for future expansion it is sitting on a cash pile.
What this means is that it has enough money for buyouts and acquisition and hence the dividend distribution ratio can really be high.
On the other hand a company that has very little profits may want to conserve the same for future expansions and may not declare dividends at all.
Also, let's say a company has net profits of Rs 10 crores, but its equity capital is Rs 2000 crores (face value Rs 10). If it distributes even the entire profits as dividend each share will fetch a dividend of only 5 paise. This would be ridiculous and it was better for the company not to declare dividends.
In short there is no fixed formula to declare a dividend. If the company is sound expect a dividend payout ratio of around 40 to 50 per cent. Or else you can expect a smaller dividend.