If Tolstoy had written a history of foreign corporations in China, it might have started something like this: "Companies that succeed in China do so for similar reasons; every company that fails, fails in its own way."
Since China opened up to foreign investment in the late 1970s, some of America's most powerful corporations have gone confidently into the People's Republic, only to stagger out a few years later, battered, confused, and defeated.
It's not because the businesses were incompetent. Many of the biggest failures belong to the Fortune 500: Mattel, eBay, Google, Home Depot. All of these have thrived in markets around the world, but not in China.
(Read more: Apple, China Mobile deal may be coming soon)
Some suffered from a lack of flexibility, or a failure to localize. Others fell because of bad timing, or a superior local competitor. While the causes are as varied as the industries themselves, a pattern can be discerned among the biggest failures in China: an inability to grasp just how different — and cutthroat — the Chinese market can be.
"It's a lack of understanding of the legal and cultural environment that leads to most failures," says Shawn Mahoney, managing director of the EP China consulting group. "The only difference between a success and failure in my experience is that people who are successful are more willing to talk and learn about how things work on the ground."
Here, we look at how four of the biggest US companies lost their way in China.
Home Depot: China's not the land of DIY
America's suburbs are full of tinkerers and home-improvement hobbyists, and Home Depot exists to serve them. With aisles upon aisles of power tools, building materials, and hardware supplies, its big-box stores are a testimony to US homeowners' do-it-yourself ethic.
On the surface, it seems like things might be similar in China. The country has a growing middle class, millions of new homeowners, and a culture of everyday ingenuity and thrift.
Wouldn't Home Depot do perfectly there?
That's what the company thought when it bought into China in 2006. The Atlanta-based firm acquired a local firm, stocked its 12 stores with tools and materials, and waited for the money to roll in.
It never did.
After six years of struggle, Home Depot shut its seven remaining stores and fired 850 workers in China.
There are several factors behind the failure. First was simply timing: Home Depot came late to China, after its competitors already had a foothold. By the time it arrived China's growth was slowing down.
Second was the nature of China's housing market. Many people buy homes for investment and speculation, not to improve.
Third was the store format. As Best Buy and other American retailers have found, Chinese consumers don't like big, boxy warehouses far away from a city center.
Finally, and most fatally, Home Depot tried to bring American notions of DIY to a market where labor was so cheap that most people simply hired a handyman.
"Home Depot, Barbie, Best Buy — they came and tried to sell the American vision, thinking people wanted to buy that," says Mahoney. "That's not what Chinese want to buy."
The company admitted as much when it left China. As the company spokeswoman said at the time, "China is a do-it-for-me market, not a do-it-yourself market, so we have to adjust."
(Read more: China's economic growth more like 4%: Marc Faber)
Mattel: Nobody wants $100 Barbie jeans
The irony of Barbie's failure in China is that Barbie, the doll, was actually fairly popular. The problem was that Barbie, the brand, was not.
Mattel's foray began in 2009, when it opened the world's largest "House of Barbie" in a prime Shanghai location. The toymaker spent $30 million making the six-story shop a temple to all things Barbie. It included a restaurant, a hair and nail salon, a cocktail bar, and a spa.
Mattel even launched a localized doll, Ling, to appeal to Chinese consumers.
So what went wrong?
Partly, it was a failure of planning. The store was too big, too expensive, and too confusing in its mixture of adult pleasures (Barbie martinis, bust-firming treatments) and children's toys.
More from the Global Post:
More fundamentally, Mattel seems to have misread the market. Instead of focusing on children's dolls, Mattel assumed that Chinese consumers would want a whole range of pricey Barbie-themed clothing, foods, and goods.
But, as author and business consultant Helen Wang points out, "Since Barbie is not a cultural icon in China as she is in America, Chinese consumers couldn't care less about Barbie-branded products."
By the time Mattel realized its mistake, the store was bleeding money. In 2011, the House of Barbie closed.
(Read more: China home prices rise for eighth straight month)
If there's a lesson, it's this: Before you go in big in China, do your homework. Companies need to be flexible, adaptable, and responsive to Chinese tastes. That means experimenting before dropping $30 million on a mega-store.
eBay: Don't neglect "guanxi"
Spend any time in China, and you quickly learn the power of "guanxi," or social connections. Guanxi drives business deals and government contracts. It's the invisible glue that ties people together. It's the sense of connection and mutual obligation that Chinese society prizes in personal relationships.
This may seem like a trivial detail for a powerful corporation. It's not.
Take the case of eBay.
In 2004, the San Jose online auctioning giant decided to enter the Chinese market. EBay bought a local company, Eachnet, switched it to the eBay platform, and expected to sweep China in short order. After all, they had dominated other countries' markets. Why not China's?
Two years later, they shut down their portal, abandoning the Chinese auction market. A local competitor, Taobao, went on to take over 95 percent of the local market share.
The problem was that eBay had no mechanism for simulating guanxi. According to a study conducted by researchers in the United States and Hong Kong, this was a crucial error. While Taobao allowed buyers and sellers to chat over instant-messaging, giving them a chance to establish a personal connection, eBay did not.
(Read more: China HSBC PMI shows economic recovery intact)
"Those buyers really want to get to know the sellers," Paul A. Pavlou, a professor at Temple University's Fox School of Business, told Pacific Standard.
In China, business is not just business. It's social.
Today, eBay says it has learned from its experience. The company has refocused away from the domestic market, toward helping Chinese sellers market directly to consumers abroad.
"It's frustrating that people say we failed in China," says Daniel Feiler, a spokesman for eBay. "From our perspective, we now have a very successful, large, and continuing-to-grow export business."
Google: Running afoul of the government
Google's Chinese defeat is one of the most dramatic, and the most complex.
The context is well known. In 2010 Google announced that it had been hacked, and would no longer be censoring at the government's behest. It moved its servers to Hong Kong. Its market share dipped from 30 percent to 3 percent in 2013.
What happened? While poor decisions in Mountain View certainly played a part, politics was what killed Google. From the very beginning of its China venture, Google was hamstrung. Launched in 2006, Google.cn was a bare-bones search engine, with no Gmail, blog software, or YouTube; the company refused to keep its servers in China, for fear of having to turn over user data.
(Read more: China is right to tame credit growth: Moody's)
In 2008, Beijing demanded that Google more thoroughly censor its auto-fill search suggestions. In 2009, Google detected a breach of its servers that the company traced to China. The attackers not only stole corporate secrets, but also rifled through the personal accounts of dissidents and activists related to China and Tibet. By 2010, Google's chiefs had had enough. They decided that they would no longer comply with Beijing's demands.
The lesson from Google's China fiasco is hard, but important. In the end, foreign companies who want to thrive in China have to abide by the rules of a repressive, autocratic government. That means either compromising with policies you may find unsavory — as Google did, at first — or getting out.
"China is a tough, large market with fierce competitors," Kaifu Lee, Google's former China head, recently wrote. "To have a chance in China, the American company must empower the local team to be responsive, autonomous, localized, and ready for combat."