“Indeed, Allah commands you to render trusts [أ/ق 2] to those entitled to them and, when you judge between people, to judge with justice. Excellent indeed is what Allah exhorts you to do. Indeed, Allah is All-Hearing, All-Seeing. (58) O you who believe, obey Allah, obey the Messenger, and those in authority among you. If you disagree over anything, refer it to Allah and the Messenger, if you believe in Allah and the Last Day. That is better and best in outcome.” [al-Nisā: 58–59].
The scholars said: The first verse was revealed concerning those in authority: they must render trusts to those entitled to them and, when judging between people, judge with justice. The second was revealed concerning the subjects, including soldiers and others: they must obey (1) those in authority who carry this out in their distribution, judgments, military campaigns, and other affairs—unless they command disobedience to Allah, Mighty and Majestic. If they command disobedience to Allah, Mighty and Majestic, (2) then no created being may be obeyed in disobedience to the Creator. If they dispute over anything, they must refer it to the Book of Allah and the sunnah of His Messenger—may Allah’s blessings and peace be upon him.
Even if those in authority fail to do this, they must still be obeyed when they command obedience to Allah, for that is part of obeying Allah and His Messenger. Their rights must be rendered to them as Allah and His Messenger have commanded, and they must be assisted in righteousness and piety, but not in sin and transgression (3).
Since the verse obligates rendering trusts to those entitled to them and judging with justice, these two principles constitute the essence of just governance and righteous administration.