For a country to be harmonic & peaceful, these 4 are needed:
1) A fair King/Government/Ruler (they do not practise any injustice)
2) Honest scholars (they speak only the truth and do not hide the truth)
3) The rich people are generous (they help the poor a lot)
4) The poor people pray for the country (for this to be achieved, 3) has to exist)
These were taught by Prophet Muhammad s.a.w.
Likewise, in the times of Prophet Muhammad, as the ruler, Prophet Muhammad was always fair. The scholars who lived during his era were all honest. Some were caught and even killed to defend the truth.
Paying alms is the 4th pillar of Islam. Besides this, the rich people in the era of Prophet Muhammad all participated in charity; they donated regularly, especially the alms which they paid yearly. In turn, all the poor people very rarely did not have food and drink to live on. As a result, they kept on praying for the safety & prosperity of the rich people and the country.
Looking back, that’s why in the times of Prophet Muhammad, all the countries which were ruled by Islam were very peaceful, including the non-Muslims who were living in an Islamic country.
Peace Be Unto You
Assalaamu’alaikumwrwb