Does Baidu’s Robin Li have the hardest job in the world? E-mail Tweet Facebook Google Plus Linkedin Share icons by Katherine Ryder @FortuneMagazine September 27, 2011, 5:23 PM EDT FORTUNE — Unlike Google GOOG , Baidu, China’s largest search engine, cooperates with the government’s policy of censorship. The western press commonly asks the company’s CEO, Robin Li, how he justifies such a decision. Naturally, Li’s responses are generally quite deferential to the government. An unfavorable onlooker might even consider some of his rhetoric to veer precariously close to pandering. Take, for instance, Li’s dictum on big tech in China: “…walking the path of socialism with Chinese characteristics is the well-spring of strength that will allow the Chinese Internet to continue its healthy and rapid development.” So it came as quite a surprise when CCTV, one of the government’s many state-run media organizations, aired a damning 26-minute documentary on Li’s company last month. Millions of Chinese viewers watched footage of a Baidu BIDU employee helping a man posing as the owner of what he admitted to be a sham healthcare company buy a fraudulent advertisement for a phony weight-loss pill. For weeks, the media speculated on the rationale behind the attack, which struck many as particularly harsh. Was the government getting uncomfortable with Baidu’s monopoly on the search market? (It controls about 80% of the market.) Or was CCTV acting out of commercial opportunism, since the broadcaster is also developing a search engine of its own? Did someone at CCTV have a personal vendetta against a higher-up at Baidu? The row seems to have passed without too many answers. Baidu TV and CCTV recently reinvigorated CCTV’s online television station, CNTV.cn, according to Duncan Clark, the chairman of BDA China, a consultancy, which is aired on Baidu. As if to close the loop, Baidu was paid a very public visit at a technology exhibition earlier this month by a high-ranking Politboro member, which usually signifies that a company is again in good graces with the government. Such is the way of doing business in China. The recent spat is part of a well-rehearsed dance between the Chinese government and its domestic tech sector. Search companies like Baidu and online media companies like Sina Corp SINA , which owns China’s version of Twitter, Weibo, are essentially information companies in a land where peddling information is not fully allowed. In 2008, internecine attacks broke out between CCTV and Baidu which led Baidu to sponsor CCTV’s 2009 spring gala and spend 41% more on advertising for the year, much of that money going directly to CCTV. In the last few months, microblogs in China have come under regulatory fire. Baidu shut down its microblogging service in August. Another underlying factor may be that state-run media companies are losing advertising dollars to private firms like Baidu, Sina Corp, Alibaba and Tencent. Government supported enterprise may be striking back in its own particular way. China’s new internet generation is proving to be less interested in local, state-run television stations like Xinhua and CCTV and more interested in new media, particularly online video. Although state media report that CCTV doubled its television advertising revenues from 2005 to 2010, such increases pale beside those of internet companies. Baidu, for instance, saw its revenues increase 60% in the first quarter of 2010 alone. What’s more, a major growth business is Qiyi, Baidu’s online video venture, which attracted 150 million users in its first year of business. What CCTV’s attacks represent, says Clark, is a fight that “is more about control and economic interests than anything political.” While it’s clearly not in the State’s interest to crimp the profits of China’s thriving private internet sector — after all, a good number of public officials have lucrative connections with such companies — Robin Li and the CEOs of Chinese Internet companies still face a very real risk. As state media companies lose lucrative advertising deals, more stringent regulation may well be in the works, cutting into the bottom line. “The real regulatory risk for Baidu may be around anti-monopoly policies,” says Bill Bishop, an independent analyst who writes for Digicha.com. “As they increasingly roll out other verticals like travel and video, they are going to be competing with other companies in China.” There is another risk for Baidu, as well. A lot of the firm’s revenue comes from the billions of dollars being invested in e-commerce sites — web sites that buy a lot of keyword ads. If the Chinese e-commerce market doesn’t take off in the way that analysts predict and a lot of these start-ups don’t become profitable, Baidu’s growth could take a serious and unexpected hit. And for Robin Li, that would be significantly more troubling than the occasional CCTV swipe.