Rule of Law
In order for a society to become a democracy and to continue to be democratic, one of the primary prerequisites is the rule of law.
Under the rule of law, all are equal before the law. The law is publicly known and accessible to all. Everyone has the right to bring a case to court. Hearings are public. One is innocent until proven guilty. One has the right to counsel and to question the evidence, and to be sentenced one must be tried before an impartial court. One cannot be sentenced and punished without a trial.
Nor can one be sentenced retrospectively. This means that to be sentenced for anything, it must have been against the law at the time of the act. The legislators cannot say after the fact: "We are making a law against what you just did, so that we can punish you."
In principle, societies ruled by law and which were not democracies could exist. There may also be societies ruled by law where the laws make it impossible for democracy to develop, for example by prohibiting free debate and forbidding people to gather.
It is difficult, however, to find specific examples of countries which are not democracies, yet ruled by law. China and Saudi Arabia are borderline cases:
China is generally ruled by law, or at least would like to be known for being so. But the Chinese have secret prisons in which political activists are held without trial. Corruption in the country is widespread so it is uncertain whether the courts are independent.
Saudi Arabia is a society not ruled by law for two particular reasons. For one, Saudi Arabian law does not regard men and women as equal. The second reason is that the country has two legal systems: a civilian system, based on courts, etc., and a religious system, which does not seem to be subject to any restrictions. The religious police are free to punish people in any way they please if people are behaving in an "un-Islamic" fashion.
Next chapter: Impartial and Independent Courts