It is hard to find a clearer outlier among developing countries than Botswana, a landlocked African country where 40% of government revenue comes from diamond mining and a quarter of adults are HIV-positive. Everything taught by a development economics department would suggest the country is set up for failure. But well-executed succession between presidents, and the resulting stability and good government, has meant success instead.

Botswana is possibly the nicest place in Africa—it is quieter and more stable than, say, Greece. In the entire period since independence, Botswana has not suffered devastating civil wars like those in the Congo or Mozambique, coups such as in Burkina Faso, or ethnic violence and expropriation as seen in Rwanda and Zimbabwe.

The country’s living standards are comparable to Turkey, Mexico, and South Africa. It has also been Sub-Saharan Africa’s fastest growing economy for most of the last half-century.

The crucial variable is a sound government making well-informed, long-term choices. A low population density paired with abundant natural resources provides a reasonable standard of living even in the absence of administrative genius or favorable conditions, so long as governance provides stability. Political instability can impede development of physical infrastructure and the business environment, transforming good fundamentals into a bad outcome. See, for example, Kazakhstan compared to Venezuela.

Unfortunately, there are many examples of countries that have tried and failed to achieve good governance in the often chaotic post-colonial context. These countries followed Western advice as closely as they could, drafting legally impeccable constitutions and recruiting well-educated statesmen, but the results have been mixed at best. Botswana’s positive outlier example raises the question of how it has done so well.

Good government starts with good leadership. Here is the list of heads of state of Botswana over the last hundred years:

King Khama III, who reigned 1875–1923, decided to join the British Empire.

President Seretse Khama, the grandson of Khama III, led the effort to leave the British Empire. He held office for 14 years, from 1966 to 1980.

President Quett Masire served as Seretse Khama’s vice president. He held office for 18 years, from 1980 to 1998.

President Festus Mogae served as Quett Masire’s vice president. He held office for 10 years, from 1998 to 2008.

President Ian Khama, son of Seretse Khama, great-grandson of King Khama III, served as Festus Mogae’s vice president. He held office for 10 years, from 2008 to 2018.

President Mokgweetsi Masisi served as Ian Khama’s vice president, and is the current president since 2018.

Given these clear personal, political, and familial ties between the heads of state, it seems that Botswana is actually an unofficial adoptive monarchy around the old royal family, quite similar to the case of the Roman Empire, where the head of state picks the successor and gives him the junior position.

In the paradigm of contemporary political science, such an arrangement is usually taken as a negative sign. We are used to thinking of political dynasties and close alliances among insiders to be cardinal signs of corruption.

This negative association is at least somewhat the result of cherry-picking. We focus on political dynasties in failed or rogue states, but minimize their very real role in successful Western states. The modern West has its dynasties, most famously the Bushes and Kennedys. This is an open secret. Statistically, one of the best qualifications for being a U.S. governor is descent from one.

But since America’s national mythology is revolutionary, and our institutions claim legitimacy from technocratic grounds of impartiality, we tend to view such dynasties negatively—when we acknowledge them at all. It might be that Western states are successful in spite of such dynasties, but even then, we can’t claim this is a crucial distinguishing factor between well- and poorly governed states.

Further, as argued by Gregory Clarke in his book The Son Also Rises, social mobility is about the same in all societies, and is much lower than we usually propose. Regardless of how meritocratic a system claims to be, power tends to remain in the same families.

Since the same people tend to come up on top overall, the rough composition of the elites in a country will not be significantly different if it implements meritocratic policies or not. The key difference between functionality and dysfunctionality is in the institutional mechanisms the elites use to cooperate with each other, rather than just the selection or composition of elites.

The arrangement we see in Botswana—where the previous head of state publicly declares a successor—solves the problem of power succession. This both helps prevent organizational sclerosis and renders succession conflicts unlikely. Many post-colonial states struggle with the problem of succession. Civil wars and coups are endemic. It is open to discussion how much of this is the result of internally driven miscoordination, and how much is due to destabilizing foreign interventions, especially during the Cold War. But at least some of the instability is internally driven.

Botswana avoided Cold War–driven instabilities by aligning with the West, but positioning itself such that the USSR had no interest in overthrowing it. Botswana was a thorn in the side of South Africa, and useful to the USSR, by sometimes allowing the communist-aligned ANC to operate in its territory. The Soviets may have worried that a revolution would simply result in a South African invasion. Thus, the only communists active in Botswanan politics were small Maoist and Trotskyist groups.

Other countries having disunified elites—possibly as a result of foreign interference—contrasts with the relative high trust that exists between elites in Botswana. In various countries around the world, there is rivalry between civilian and military leadership. When trust and coordination are low, the military and civilian government distrust each other, and there’s no simple bridge between the two. For example, the Communist Party of China may not wish to allow the People’s Liberation Army to become too independent or strong, since this would make a coup viable.

In such situations, if the military remains an effective organization, ambition will often be sated by directly deploying the military to subordinate the civilian government and make war on the elites in control of it. At best, this results in a coup. At worst, a civil war.

Ian Khama resigning from the military before entering civilian politics, rather than using the position of general to install himself directly, however, is an example of the way military leaders can acquire political power without setting a precedent for coups. One of the key variables in determining whether a country has a coup is how many coups it has had in the past. It further demonstrates a degree of coordination and deal-keeping among elites. There is a direct analogy here to the practice of successful U.S. generals who became president, such as George Washington, Ulysses Grant, and Dwight D. Eisenhower. That military leaders can rise to power through the civilian government demonstrates a high level of trust among Botswanan elites absent in most Third World states.

Historically, in another feat of competent political strategy, Botswana joined the British Empire on its own terms under King Khama III, preserving its autonomy. The tribal structure continued to govern during the colonial period, building its own bureaucracy. This means the current state stands on an actual base of power rather than being a legal fiction.

Moreover, compared to other African states, Botswana has a relatively homogeneous ethnic makeup, with a single dominant tribe, the Tswana. This helps stability because it means the tribal power structure and the formal government structure are one and the same in practice, reducing motivation or opportunity for political conflict.

The demographic fundamentals are not perfect, however. As Amy Chua argued in her book World on Fire, one of the most important drivers of civil war, expropriation, and genocide is the dynamic of conflict between an ethnic majority with an economically dominant minority. The political conflicts between the Hutu and the Tutsi in Rwanda are a canonical example.

Superficially, the conditions in Botswana are present for the development of such a scenario. A significant minority of the population, around 3%, is white. This minority has substantial social and material capital. And yet, it continues to exist with few problems after half a century of independence, with no campaign of expropriation or expulsion, unlike countries such as Uganda.

What is the source of this rare good fortune? It seems it was good judgment by the ruling dynasty. Seretse Khama pursued independence in a much smarter way than had been done in countries like Zimbabwe. For example, his government bought half of the local branch of the international De Beers corporation, rather than seizing it. Seizure is disruptive and often destroys a company’s ability to produce as the best managers and engineers flee, while purchase ensures continuity and continued production.

Income from taxing or owning shares of such large companies can be used for patronage of political allies (Sheila Khama served as CEO of De Beers Botswana) as well as social programs that develop state power further. This reduces the pull of alternative institutions such as clans, radical religious groups, and ideological organizations. Another well-known example of this tactic is Saudi Arabia’s use of the Saudi Aramco oil company.

Retaining the friendship of the world’s diamond monopolist doesn’t hurt the important foreign policy necessity of maintaining good relations with Western powers. Further, not cooking the goose that lays diamond eggs makes expropriation measures aimed at prosperous minorities less attractive in the long run, as there is less financial need to do so. Expropriating De Beers might have interfered with its ability to maintain its monopoly, and thus high diamond prices, rendering the spoils much less valuable anyway.

Simply looking at a picture of former president Ian Khama reveals that the most prosperous ethnicity married into the traditional royal family.

The marriage of President Seretse Khama, Ian’s father, was controversial at the time, likely an act of love rather than intentional statecraft. However, it was read by the white minority as a credible commitment to ethnic peace. Because of these obvious and noticeable family ties, the political capital of the influential Khama family cannot be shored up by inflaming inter-ethnic conflict for political gain as was done by Robert Mugabe in Zimbabwe and Idi Amin in Uganda. The family is thus reassuring for the white minority, while simultaneously legitimate to traditionalist Tswana.

Good government aligns political necessity with prosperity. When political necessity steps in the way of prosperity, it is prosperity that suffers.

Ethnic conflict can sometimes be politically useful, but is economically and socially harmful. The marriage decision made any such conflict politically more costly and less useful—just as the partnership with De Beers turned economic capital, which could otherwise only be wastefully burned for political capital, into an ongoing source of political support.

Plenty of autocrats at least try to name their successors. Botswana succeeds where they fail by prudent use and promotion of good fundamentals that make succession crises and intra-elite conflict much less likely: trust between military and civilian elites, exemplified by Ian Khama retiring from the military to go into civilian politics, means there’s no point in a coup. The formal government being effectively the tribal power structure of the dominant tribe, with the tribal royal family holding political office, means little shear can arise between government and ethnic power centers. The relatively homogeneous economy centered around De Beers, which is well integrated via the government’s ownership stake, reveals a single point of financial patronage that is aligned with government interests. Furthermore, good positioning through the Cold War meant no foreign power had interests in toppling the Botswanan government.

According to conventional developmental economics models, Botswana shouldn’t be doing as well as it is. As a landlocked country, its access to international markets relies on neighboring states. This is commonly recognized as an important barrier to development, with its own acronym “LLDC” (landlocked developing country). It is suffering among the world’s worst AIDS pandemics. This not only incurs significant direct medical expenses, but also lowers productivity. Morbidity drives up the dependency ratio, depriving it of a demographic dividend. Lastly, it is a post-colonial state. The norm for this reference class is corruption, political instability, and unexceptional growth. Together, these factors should have sealed its fate.

But our usual models do not sufficiently account for the difficulty and importance of succession. We model power and power succession unrealistically, if at all. Hand-picked successors and political dynasties are overlooked as viable solutions, or regarded as a sign of corruption. Thus we usually miss or shrug at Botswana’s success, and likewise miss some of the key sources of functionality in our own governments.

The world, including its functional governments, is a lot more dynastic than we like to admit, and dynasties work a lot better at securing institutional continuity and good government than we like to think. As we look into what’s actually working about the American order, and how it could work better, we should pay close attention to cases where dynasties like the Khamas are a significant driving force of success. We would do well to become more comfortable with their role.

Samo Burja is the founder of Bismarck Analysis, a political risk consulting firm. He is also a research fellow at the Long Now Foundation. You can follow him on Twitter @SamoBurja.