But if good public education and low religiosity were the magic bullets, the Soviet Union would never have fallen; if homogeneity was necessary, Singapore wouldn't work and the Ottoman Empire would always have been dysfunctional; if high religiosity was bad in itself, Bavaria would be a hellhole. Some religions get in the way, others don't -- and some actively help to enrich their societies. (Zoroastrianism should come to mind. Rice was the staple crop of Persia before it was the staple of China, thanks to pious Zoroastrian agricultural research; and building an aqueduct or draining a swamp was a fast path to paradise. Down to the present, the Zoroastrians do pretty well for themselves -- the Parsis of India are the main population of Zoroastrians today -- and some of their habits of mind seem to still be present in Iran today.)
I've come to believe that the potential to rise in social position is what matters most, except possibly in Zoroastrian societies. Appalachia, Sicily (including lower-class parts of Boston), and the Middle East all agree that where you were born is where you'll stay, and that ambition is ridiculous or contemptible; while the healthiest societies are the ones where talent can bubble to the top even if you're not the judge's son.
My favorite example of the vitality that social mobility brings is the Ibo of Nigeria -- "the Jews of Africa", the most successful and energetic of West African peoples. Also look at the dynamic nature of the early Islamic world, compared compared to the stagnant nature of the modern one. And what's true of the Islamic world is equally true of the Iberian one; Brazil and West Virginia have the same basic problem. And back in the Middle Ages, too, it was the most fluid societies -- Lombardy, England, the Low Countries, and the Iberian states -- that were the most successful ones.