There is a link between the Prophets,a just society, and Divine Justice, writes a scholar from Imam Rassi Society:
The role of prophets was multifold. They served as living, breathing visual representations of the Creator reaching out to His creation.
One of the prophetic functions was to perfect and correct concepts of the Deity that were subsequently coloured by human frailties and weaknesses.
Some human beings brought the Divine to their level by ascribing lowly attributes that robbed Allah of His Transcendence, others tried to elevate themselves to the level of the Divine by promoting themselves as Sovereign entities that subjugated the masses by “Divine Right”.
The prophets came as heralds, to free the minds of the masses from these gross travesties of human invention. They utilized many creative means to instruct the masses in the Divine realities, by affirming the Divine attributes. They also “spoke truth to power” in order to remind despotic leaders that their earthly power and authority does not denote an ounce of Divine power; even a bothersome fly could unseat a king.
One of the functions of the prophets was to establish justice. It is not enough to exercise the individual human soul with sublime concepts but leave him to fend for himself in a chaotic society. It is rather the role of a teacher to make sure that the learning environment is suitable for the mental and spiritual development of the student. Likewise, prophets fought to establish just societies in their immediate locales. The establishment of justice also served as a material paradigm of Divine Justice; meaning that if a human despot would be improper, then a Divine despot would be even more improper.