It's not often that a company you've criticized invites you over for a tour and tea, but that's precisely what happened to me recently in Beijing when I visited Baidu's (Nasdaq: BIDU) corporate campus in the northwestern part of the city. And after spending a full day meeting employees and getting a sense of the company's culture and growth strategy, I'm beginning to think that my skepticism of the company has been misguided.

I'll tell you why, but first I need to explain what I used to think.

This story begins 1,800% ago
Baidu went public in 2005, and given the excitement about emerging markets then, the stock nearly doubled on its first day of trading. It's looked expensive to me ever since. One reason for that is Baidu was (and to some extent remains) a Google (Nasdaq: GOOG) clone. Like so many Chinese companies, it's taking cues, hints, and ideas from a Western business but gaining a competitive advantage in China thanks to local knowledge.

Although this frustrated me on an intellectual level, I let that frustration cloud my investing assessment of the company. After all, every company learns from its competitors, and it's an asset -- not a liability -- to use that learning to gain a competitive advantage. In Baidu's case, that advantage -- coupled with Google's unwillingness to play ball with the Chinese government on Internet censorship -- has been immense. Baidu's market share in Internet search has increased from less than 70% in 2005 and 2006 to more than 86% today, even as the number of Internet users and searches in China has skyrocketed.

The company's massive sales force is teaching small businesses about keyword advertising, and as a result, its revenue is up 90% annually, and its profit has risen more than 160% annually over the past five years. What's more, Baidu's operating margin has reached an incredible 51%, which shows just how much leverage this business model has. As you might expect, the stock has done well, too: It's almost a 20-bagger.

I remained a skeptic
Yet even as Baidu proved it was a solid company and gained more market share as Google left China, I continued to doubt its future. The stock was selling for more than 50 times EBITDA, so the company's long-term growth potential was clearly factored into the price. But my hypothesis was that over such a long period, China's Internet restrictions would ease and Google would re-enter the market -- bringing a superior search algorithm and brand cachet earned by standing up to censorship. I thought that together, those things would help Google chip away at Baidu's market share and, therefore, at its business.

To be honest, I thought Baidu was a better short than it was a buy, and I wrote in December 2010, after a Wikileaks release revealed that the Chinese government was actively working with Baidu, that investors should buy puts. This looked like a situation where the competitive advantages so many investors perceived in the stock were being artificially created. The stock is up 30% since then.

Don't short this stock
But what I saw at Baidu has me changing my tune. I still don't think Baidu is up to par with Google on the tech or innovation fronts, but the young, flat, and hungry organization is getting there. Baidu is a learning machine, and the company's vision and corporate culture are light-years ahead of its Chinese Internet peers. And with better than 86% market share, it's compiling a lot of data it can use to improve its search algorithm. Google may eventually return to China, but its technological advantage will probably have eroded by then. Add in the fact that ingrained Internet habits are hard to break, and Baidu's market share seems secure.

Baidu has years (maybe decades) of growth ahead. Just 35% of China's 1.4 billion people are online today, which means there's an untapped market in China three times the size of the United States. And the company estimated that it's working with just 1% of China's more than 40 million small- and medium-sized companies, meaning there's much more ad money out there to spend on Baidu. Finally, it's getting smarter about monetizing its search. Baidu used to sell keywords to the highest bidder, but its new platform awards the keyword to the bidder who drives the most revenue. That's a function of the bid plus the number of clicked links and completed transactions. In other words, the companies that offer shoppers the best deals get the most prominent ads -- creating a virtuous cycle that leaves everyone more satisfied.

While Baidu looks expensive at 60 times EBITDA, it's a relative bargain in its peer group -- particularly since it's one of the few that's making more and more money:

Company

EV/EBITDA Ratio

TTM Net Margin

2010 Net Margin

2009 Net Margin

Baidu

59.6 times

45.4%

44.5%

33.4%

Sina (Nasdaq: SINA)

51.4 times

(6.8%)

(4.7%)

114.9%

Youku.com (Nasdaq: YOKU)

N/A

(43.0%)

(52.9%)

(118.7%)

Renren.com (NYSE: RENN)

230.2 times

(83.8%)

(83.8%)

(150.2%)

Sohu.com (Nasdaq: SOHU)

7.7 times

24.8%

24.3%

28.7%

Qihoo 360 (Nasdaq: QIHU)

N/A

(16.1%)

14.8%

13.0%

Source: Capital IQ, a division of Standard & Poor's.

So am I buying Baidu?
Just because a stock is relatively a good deal doesn't make it absolutely a good deal. While I'm still torn if I should complete my 180 and buy Baidu, my analysis thus far tells me that at $130 per ADR, the market, in addition to assuming further Internet penetration in China, is pricing in revenue growth from approximately $0.006 per search to $0.035 per search over the next decade. That looks aggressive in that it's greater than 20% annual growth, but conservative in that Google is monetizing its U.S. business today at approximately $0.10 per search.

At this point, I could go either way. While I was definitely wrong about betting against Baidu, I still have some work to do before I'd be comfortable betting on it.