Marissa Mayer became the CEO of Yahoo on July 16, 2012. Since then, the stock has exploded from ~$16 to over $35.

But while Mayer has done a remarkable job improving the working culture at Yahoo, hiring mobile developers and redesigning the company's wide array of products, she is not the only reason for Yahoo's stock turnaround.

In fact, the main reason Yahoo stock is up so much is that way back in 2005 Yahoo bought 40% of a tiny Chinese e-commerce company called Alibaba for $1 billion.

Then, over the next six years, Alibaba turned into a massive hit.

In the spring of 2012, Alibaba bought a portion of its stock back from Yahoo for $7.65 billion. When Mayer took over in the summer of 2012, she agreed to use some of that money to buy back Yahoo stock.

This financial engineering drove Yahoo's stock price. So did Yahoo's remaining stake in Alibaba, which continued to grow in value as the Chinese company's market cap went from ~$50 billion in 2012 to a rumored $100 billion now.

Soon, Yahoo will be able to realize that gain. Alibaba is expected to IPO in 2014. When it does, Yahoo will sell all but 10% of its stake in the company, adding another few billion dollars to its bank account — money that will almost certainly fuel more share buybacks.

Despite its prominent role in Yahoo's turnaround, Alibaba remains a mysterious company in the U.S. To remedy that, I visited the company during my recent trip to China.