Editor’s note: When the Chinese e-commerce giant Alibaba goes public, as it will soon, Yahoo will earn many times its significant original stake in the company — a surprising ending to a tale of experimentation and discovery. Sue Decker, Yahoo’s former president, describes how the deal came about and what Yahoo learned from doing business in China.

In May of 2005, Yahoo CEO Terry Semel, cofounder Jerry Yang, corporate development executive Toby Coppel, and I — I was then chief financial officer of the Silicon Valley internet company — went on what would turn out to be a fateful trip to China. Less than a decade later, the ownership stake that resulted from that trip has been the saving grace for the company that had dominated the early internet. The value of the shares bought then, in fact, makes up a big chunk of Yahoo’s value today, and the windfall from that purchase is what many hope will allow the company to remake its future.

At the time, though, we were just in search of a new approach to building a sustainable business in that critical but often difficult market. Things hadn’t gone well up until that point. In fact, you could say (and many did) that our previous attempts had failed, in that we hadn’t established a sustained market position. And then we found Alibaba — and it found us — and that connection led to the partnership that ultimately proved to be remarkably successful. This success was built on what we learned from our prior efforts, as well as a resolve to take new risks to do what was necessary to succeed.

In some ways, the lessons ring with greater clarity nearly a decade on and might shorten the pathway to success for other business leaders seeking growth in China.

Build, Buy, Partner

Yahoo’s forays into China started with a build strategy, which later became a buy strategy and ultimately morphed into a partnership strategy. In each iteration, we spent a lot of time thinking about what might make the best use of our existing product. In hindsight, this thinking turned out to be far less important than what we learned about leadership, control, and trust, which ultimately were reflected in how each of the businesses was created, capitalized, and staffed.

Yahoo China was launched in 1999 as a platform for email and instant messaging, translation of U.S. content (news, finance, weather) into two Chinese languages, and directory access to 20,000 web sites, an approach that the company had adopted elsewhere.

The number of internet users in China stood at roughly 5 million in 1999 but grew to 40 million in 2002, by which time it was clear that Yahoo was not getting the traction that local Chinese internet companies were seeing. Revenue was only a few million dollars, and we were drawing just 5 million to 10 million users each month. With the ad market under $70 million, many of our local competitors were rapidly experimenting with new types of revenue and business models and were far ahead of us. As a result, they amassed much larger user bases and were collectively generating close to $100 million.

The solution, we decided, was to acquire a local company that had already gained traction in the market and that could provide us with proven local management as well as help us with web search, which had become a priority after we bought U.S. search engine company Inktomi in 2002.

In November 2003, after due diligence, we announced our agreement to purchase 3721 for $120 million. The company had five years of growth experience and nearly 200 employees; most important, it was run by an aggressive local internet entrepreneur, Zhou Hongyi.

3721’s core product was essentially an early form of search: a browser download that helped users in China go directly to destination web sites. The company generated revenue from selling hundreds of thousands of Chinese language keywords for Latin alphabet domain names.

The idea was simple: Combine the best of both companies into the new Yahoo China, which was projected to generate more than $25 million in revenue in 2004. We had 300 people — mostly local talent — and together we were reaching more than 50 million users each month. We were optimistic about Yahoo’s future in China as the deal closed in January 2004.

By mid-2004, however, the operation was mired in conflict over control and differences in management style. Zhou reportedly felt that the original Yahoos were overpaid and lazy, whereas the Yahoo team felt bullied and believed Zhou wasn’t focused on the Yahoo operations. We insisted that the local team follow Yahoo reporting, systems, and governance requirements. Not surprisingly, this didn’t sit well with the local team. Zhou departed in 2005 and went on to found Qihoo 360 Technology, a $12 billion company that now trades on NASDAQ.

Although Zhou had outperformed the financial plan, the gap between 3721’s market position and the local competition was widening.

During the first half of 2005, Yahoo’s executive team studied the landscape carefully, looking at companies to acquire or partner with. And so began that auspicious trip in May of 2005, in which Semel, Yang, Coppel, and I set out to meet dozens of business leaders and government officials over the course of a whirlwind week.

Most of the companies we met with were publicly held, but Alibaba was still private. The company was owned by management, venture capitalists, and SoftBank. We met with founder Jack Ma and his chief financial officer at the time, Joe Tsai, and we immediately felt a strong cultural alignment.

Alibaba was based in the south, in Hangzhou, and had about 2,400 employees. The previous year the company had generated more than $4 billion in gross merchandise sales through its platform, yielding about $50 million in revenue. It also had two start-up business lines, Alipay, a new payment system designed to work like Paypal; and Taobao, an auctions site. Both were offered free to consumers and merchants.

We were impressed with Ma’s visionary and principled management philosophy, and we liked how our two companies might fit together. We also had the financial resources to help Alibaba weather the days of offering auctions for free as it attempted to compete against eBay.

We thought there might be a window of opportunity to build a leadership position in search and commerce in China to complement our portal offerings. We returned in late May to Sunnyvale, California, and began an intense two-month period of negotiation to craft what became the joint venture with Alibaba.

Yang had struck up a good relationship with Ma, which greatly facilitated the negotiations. On the finance and deal side, we also felt a strong kinship with Tsai. The deal was complicated to structure, but we eventually decided that Yahoo would own 40%, SoftBank would hold 30%, and existing management would keep 30%. Ma and the Alibaba leadership team would retain management control.

The deal was valued at just over $4 billion, with Yahoo putting in $1 billion in cash and our Yahoo China assets, which were then valued at $700 million. It was an attractive offer and a step-up in value for us, considering the value of what we had contributed to 3721 and its $120 million purchase price two years earlier.

While Yahoo China was tracking toward about $40 million in revenue in 2005, Alibaba’s consumer business alone was poised to do more than double that for the year, so it was valued at close to double our operation. At the time this seemed like a big leap of faith: More than half the value of the venture — more than $2 billion — was attributed to Taobao and Alipay, both of which were losing money and had announced that their services would be free for at least the next few years.

Still, we announced the deal by early August, less than three months after the trip that gave birth to the venture.

Key Lessons Learned

Looking back now, it is clear that there were three primary factors that ultimately led to the Alibaba deal’s creating value in the Chinese market.

Probably the most important element of Yahoo’s ultimate success was “failing fast”: recognizing mistakes early and being persistent about trying new and different ways to approach the market.

Continuous learning and a willingness to experiment are crucial for companies exploring new markets. I serve on two boards — Costco’s and Berkshire Hathaway’s — with Charlie Munger, a legendary business leader with an abundance of wisdom. He says he has constantly seen people rise who are not the smartest but who are “learning machines.” “They go to bed every night a little wiser than they were when they got up,” he says. He also has a broader view, which I really love: “If civilization can progress only with an advanced method of invention, you can progress only when you learn the method of learning. Nothing has served me better in my long life than continuous learning.”

A second critical principle that contributed to our success in China was the realization that we had to be willing to loosen the reins of control. This runs counter to the behavior of most corporations and counter to our earlier attempts. In the media and internet industries, it turns out to be very important when operating in China.

The most “controlled” approach we took was in our initial build strategy: Yahoo controlled the product and the team and centralized the compliance functions, such as finance and legal. To do that, we relied on talent hired by Yahoo employees and recruited managerial talent from within Yahoo. This facilitated communication to headquarters and know-how on the ground, and it seemed a comfortable way to access a new market, considering the great distances, both geographic and cultural.

But the local hires in China felt that our Sunnyvale leaders did not understand the market — they viewed them as outsiders. This created tension from the get-go. But there were bigger problems. Headquarters took too long to approve locally generated ideas, and as a consequence, Chinese competitors were beating us with rapidly-turned-out products that were tuned for the local market.

We were ready to do things differently when we purchased 3721. We gave up a lot of the product control to an aggressive and experienced Chinese leader and allowed the local unit much greater latitude for decision-making. We also empowered 3721’s top team to manage the combined operations, including those of the former Yahoo China. Only legal, finance, and human resources still reported back to headquarters.

But 3721 got bogged down dealing with the people issues that emerged from two different cultures and business practices. Those issues slowed us down on the product side as well.

So with Alibaba, we realized we needed to be willing to give up all operating control. Practically speaking, this meant forgoing our previous desire to own more than 50% of the local operations. It also meant we would leave all employee issues to our partner and allow our code to be used by people with no previous connection to the company. Scary.

But the real key to our ultimate success in China was the match with Alibaba’s leadership team. We had seen hierarchical, top-down management systems in place in many Chinese companies. Ma, by contrast, displayed a distinctive humility and openness. Although he didn’t have a U.S. education, he was an avid student of U.S. management and leadership practices, as he told us in our earliest meetings.

Unlike other Chinese leaders we had met with, Ma was willing and eager to hire executives who had more skills and experience than he did in areas where he was less strong. Tsai, for example, clearly understood U.S. business practices and had strengths that complemented Ma’s in strategy and setting the vision.

A 2010 Harvard Business School case by Julie M. Wulf noted that Ma studied Jack Welch’s approach and was inspired by GE’s decentralized decision-making. Like Welch, Ma wanted his executives to be free to do whatever was needed to make their units the best businesses in their fields.

This felt like the change we needed. We were ready to give Ma the keys to Yahoo’s operations in China.

Beyond the Yahoo Experience

Many other U.S. companies were either entering China or making plans to do so around the same time that Yahoo was making its early moves. All entrants faced a similar set of circumstances and conditions, including unfamiliar laws and customs as well as an array of business challenges – for example, non-Chinese social-media sites are blocked to a greater extent than local ones. According to GreatFire, a Chinese web-traffic monitor, more than 2,600 websites are blocked by China’s censorship policies. This extends to any non-Chinese user-generated-content sites such as Facebook, Twitter, and YouTube. Whether they are blocked because of political concerns or to promote local competitors, the impact is the same.

Most would-be entrants made the same mistakes Yahoo did, and many left the market after early disappointments.

The most interesting attempt at a buy strategy was eBay’s 2003 purchase of Eachnet, which had a nearly 80% share in the auction market. By 2005, eBay was already being locally outmatched — by none other than Jack Ma’s Taobao. Ma had launched Taobao to defend Alibaba’s business-to-consumer business and therefore decided not to charge listing fees, as Eachnet did. He also offered live chat so users could make deals together and build trust, a feature eBay rejected out of fear that users would transact directly and avoid Eachnet’s listing fees. Taobao’s service was faster than Eachnet’s, because its servers were located inside China. At the end of 2006, eBay pulled out of the market.

By contrast, Google primarily pursued a build strategy that was similar to Yahoo’s first foray. Google rolled out a translated version of Google.com in 2000, running on U.S. servers. The site was slow and often censored or shut down, causing it to lose market share over time to Baidu. Even after Google launched a local version of its code, using servers in China, it garnered only about one-third of the market to Baidu’s two-thirds. Ultimately, after Google moved its business to Hong Kong and China banned access, Google’s attempt to compete in China came to an end. But how much of the decision was due to the political climate and how much to being outgunned operationally is unclear.

AOL approached China through partnerships and investments, none of which appear to have borne fruit. Amazon purchased Chinese local firm Joyo in 2004 but has not kept up with local competitors such as Taobao Mall and Jingdong Mall. Amazon has launched a cloud service and an app store but claims only about 1% of the e-commerce market in China.

Social sites such as Facebook and Twitter have been unable to make inroads because of government blocking and competition from strong local sites.

The bottom line: Yahoo is the only example of meaningful value creation by a U.S. internet company in China.

Yahoo had failed at first too, of course. The difference was that it kept going back, building on knowledge from prior attempts. In the early days, we invested a lot of energy in analyzing which businesses would fit best with Yahoo. But I can see in hindsight that what mattered most was finding the right team, including a leader who was a good cultural fit with the company and whom we trusted, and structuring the deal so that the local unit was free to make operational decisions.

Nine years later, the venture has gone through a number of changes. For example, Alibaba was listed on the Hong Kong stock exchange in November of 2007, raising $1.5 billion — the world’s biggest internet offering since Google’s IPO in 2004. The company subsequently went private in early 2012. There have also been changes in the framework agreement around the ownership of Alipay in both 2011 and 2012, as well as a buyback of almost half of the Yahoo stake in May of 2012 for $7 billion.

These changes would have been hampered by a layer of operating control from the U.S. parent. For example, Alibaba never really emphasized the products of Yahoo China in the market; Alibaba’s interest in the Yahoo deal was largely to secure cash to help fund operating losses at Alipay and Taobao and to leverage the Yahoo brand for Alibaba’s global business. The core structure of the transaction empowered Ma and his team to make the decisions to drive long-term value. Yahoo felt it could live with this arrangement. But Yahoo never would have structured a deal this way on its own.

Today Alibaba is ranked beside Google, Facebook, Twitter, and TenCent as among the titans of the internet. With the filing of Alibaba’s registration statement in early May of 2014, the company is set to tap the U.S. capital markets in what is estimated to be one of the largest IPOs ever. Analysts estimate that the company will be valued at more than $200 billion.

That works out to 40 times the value of the deal we struck in 2005. Had Yahoo held its entire 40% stake from the time of the deal, the value of its pretax share in Alibaba would be worth $80 billion, or more than $78 per Yahoo share. Even though Yahoo has sold close to half that position and currently holds a 23% stake at lower valuations, the company will be reaping a huge return.

Looking back, it’s clear to me that this windfall is the result of talents we didn’t even know we possessed: It turned out we were good at identifying the right partner in China and good at acknowledging our errors early on. We also kept getting up, after we were knocked down, and trying again. We did this over and over until we found a workable approach. We also learned how to relinquish control and go wherever the market took us. And where it took was to a business relationship that proved more fruitful than we could have imagined.