The beginnings of an answer are provided by a recent paper from Saumitra Jha, a political economist at Stanford. The paper shows that some cities had a head start because of (what else?) economics. In particular, Jha develops a mathematical model to show that trade networks, which could be exploited by Muslims more easily than by Hindus, combined with aspects of redistribution to create a stable system in which both communities had an interest in maintaining communal harmony. When there were “complementarity” of resources — one community could do something better or cheaper than another; when that advantage wasn’t something that could be stolen or expropriated, like wealth — trade networks in the Indian case; and when both communities felt that some of the excess gain were going to the city as a whole rather than to individual communties — in the medieval Indian case, through lower prices; then we could expect stable, peaceful, multi-ethnic cities.
Jha goes on to show how those incentives would support the evolution of institutions of civic engagement. Most daringly, he’s willing to claim that there are methods in which minority communities can make their own cities safer — such as, for example, by being notable for community service, such as the Parsis or Ismailis in Bombay. However applicable or inapplicable those conclusions, there is little doubt that understanding how to encourage co-operation and co-existence is a more than useful start.