Mike Mozart / Flickr

Walmart had its worst day in almost 30 years on Wednesday, after the company released dire predictions for profitability. While analysts had expected modest growth of 4 percent in the coming fiscal year, the big-box retailer forecast a decrease of 6 to 12 percent.

One way to look at this is to say the reasons for Walmart’s decline are complex. Many analysts have expected for years that Walmart, the world’s largest retailer, would falter. The financial crisis served Walmart well, as its el-cheapo reputation made it a hub for skint shoppers. But with the economy in a long (if still slow) recovery, there’s an increasing desire among shoppers for more tailored experiences. Nothing seems more antithetical to the era of bespoke, small-batch goods than Walmart—though this artisanal cheese and fruit basket, at just $78.99, looks pretty good. Web commerce has cut into Walmart’s margins, and competitors like Target have caught up. And while the company has resisted unions, it has been forced to sweeten its pay packages, which reduces some of its competitive advantage.

So that’s one way to understand what ails Walmart. Another is to look at it from the perspective of a management guru. Not Clayton Christensen. Not Peter Drucker. Not even Sun Tzu, the Chinese military theorist recently in vogue on Wall Street. The man to consider is the 14th-century North African Muslim scholar and philosopher Ibn Khaldun, sometimes considered the forefather of sociology. He might say that what’s happening to Walmart was practically inevitable.

“Empires age and decay in the course of three generations,” Ibn Khaldun warned. And while his theory referred to early-modern desert dynasties, it could easily apply to Walmart. (This wouldn’t be the first time Ibn Khaldun was pressed into service for understanding the American economy: Ronald Reagan, a fan, cited him in support of supply-side policies, somewhat to the chagrin of scholars.)

In the first generation, Ibn Khaldun wrote, an empire is founded by rough-hewn bedouins, thirsty for power, closely tied together, and always wary: “Their swords are kept sharp, their attack is feared, and their neighbors vanquished.” In the second generation, things are still good: “Possessing dominion and affluence, they turn from nomadic to settled life, and from hardship to ease and plenty.” Yet the close bonds of kinship and family that made the empire so resilient start to erode. The dynasts begin to hire outside managers and mercenaries to maintain their empire. They rely ever more heavily on bureaucracy. This generation oversees the peak of the empire’s glory, but things tend to stagnate a bit, and while what they bequeath to their heirs looks powerful on the outside, it is hollowing out underneath.

In the third generation, the empire tends to fall apart. The second generation was raised in splendor, but its members were reared by the same rough and ready desert natives who had founded the empire. The third generation, however, has known nothing but the palace. Its members don’t have the same enterprising spirit, and they fall short of their ancestors’ models. “Their national spirit is wholly extinguished; they have no stomach for resistance, defense, or attack,” Ibn Khaldun wrote. “Nevertheless they impose on the people by their bearing and uniform, their horsemanship, and the address with which they maneuver.”

This lines up uncannily with the Walmart story. Take Sam Walton, patriarch of the dynasty. What is America’s equivalent of the desert in early-modern Arabia? One good candidate is Bentonville, Arkansas, a rural Ozarks town of fewer than 3,000 people when Sam Walton opened his first store there. But Walton was wily, wise, and energetic, and he converted that store into a huge chain, overwhelming more established competitors like Kmart—companies that had themselves grown complacent over time. By the time Walton died in 1992, Walmart was the largest retailer in the United States.

Under the Walton family’s second generation, Walmart reached its peak—with an incredible $486 billion in revenues on last count. The family has done well, too; four living members of the second generation are all worth at least $30 billion (though heirs lost $11 billion in Wednesday’s slide of Walmart stock). But the family has come to rely on mercenaries, as Ibn Khaldun predicted—or as we call them in modern parlance, business executives. The hired guns have made the company lots of money, but they have also sometimes led in unwise directions. Walmart has pled guilty to environmental crimes and paid out tens of millions in settlements. An inquiry into whether the company paid bribes overseas has cost it almost $500 million. Several high-level executives were forced out following that investigation, members of the family have become interested in pursuits outside Walmart, including philanthropy and art.

Now, concurrent with the tumble in share prices, the third generation of the Walton family is taking the reins. This summer, Greg Penner—Sam Walton’s grandson-in-law*became chairman of the company. Walmart is struggling to tame its bureaucracy and reduce layers of management. Labor organizers continue to attack Walmart as a bully, picking on underpaid workers—just as Ibn Khaldun accused third generations of parasitism and bullying.

So does Ibn Khaldun’s schema mean that Walmart is destined for death? Kmart and Sears certainly don’t offer hopeful precedents. While nearly 40 percent of family-owned business are passed to a second generation, only 13 percent or so make it to a third. There are also notable exceptions, and one of them, Ford, has profited immensely under the leadership of outside CEOs, while a member of the family's fourth generation is now chairman. Family-controlled firms make up 19 percent of companies in the Fortune Global 500—though that’s driven by the growth in Asian economies where corporations tend to be run by families.

Luckily for the company, Walmart isn’t unaware of the challenge it faces. It has begun trying to make the company more limber, introducing smaller stores, building its e-commerce presence, and stocking fresher and local goods (to Whole Foods’ dismay). Still, some of its moves suggest continued trouble ahead—a planned stock buyback is a potential omen of more bad news, one analyst wrote.

If this turns out to be a negative turning point for Walmart, it will be another triumph for Ibn Khaldun—more than 600 years after his death. But pattern isn’t prophecy, and the scholar’s words offer a warning both to those who would assume Walmart can’t survive simply based on his writing: “Many errors committed by historians, commentators, and leading traditionalists in their narrative of events have been caused by their reliance on mere tradition.”

* This post originally stated that Penner was Sam Walton’s grandson. We regret the error.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.