By Bill Powell
October 11, 2012

FORTUNE — Tim Cook, Apple’s reserved and soft-spoken CEO, has a tendency to wax euphoric about the China market and his company’s place in it.

When asked last year by an analyst whether China could replace the U.S. as Apple’s biggest market, Cook positively gushed. “How far can it go?” he responded, referring to China’s prospects. “Certainly in my lifetime I’ve never seen a country with as many people rising into the middle class, with people wanting to buy Apple products.” He didn’t directly answer the analyst’s question, but concluded, “The sky is the limit.”

You may think you know the story of Apple (AAPL) in China — how the men and women who make iPods and iPhones for Apple partner Foxconn labor under punishing conditions. But there’s another Apple Goes to China story, and this one is the tale of an underdog — yes, underdog — that has the potential to unlock billions and billions of dollars in additional revenue, just by eking out market share gains in core products such as smartphones and PCs. If you think Apple, the most valuable company in the world, with a market cap of nearly $600 billion, has nowhere to go but down, we humbly suggest you turn your gaze to the East.

Even as China experiences a sharper-than-expected economic slowdown, it continues to mint millions of consumers who covet Apple’s products. In its fiscal first half of the year, Apple has reported $12.4 billion in sales from greater China, and analysts believe Apple could garner $25 billion or more in China sales in calendar 2012. And that’s up from $13.3 billion last fiscal year, and almost nothing five years ago. In 2007 — the year before the iPhone became available internationally — Apple’s annual revenue from China was “a few hundred millions of dollars,” Cook has said. The company didn’t open its first store in China, a modern glass-and-metal structure in Beijing, until 2008, a full seven years after launching its retail strategy in the U.S.

MORE: Facebook’s China problem

Now consider that for all Apple’s gains in China, the country remains a relatively small contributor to the device maker’s revenue mix. Of its $108 billion in 2011 revenue, only 12% came from China. (In contrast, sales in the Americas topped $38 billion.) Could China someday become Apple’s No. 1 market, and how? There are many things Cook could do to bolster his company’s position: He could customize products for China or expand Apple’s retail presence. To date there are only five Apple stores in mainland China. And he could really move the needle by striking a deal with China Mobile (CHL), the world’s largest wireless operator, with 655 million users on its network. (Apple already has deals with China Unicom (CHU) and China Telecom (CHA).) It would seem China — more than a much-anticipated Apple television or another version of the iPad or the next hot app — represents Apple’s next big opportunity. There’s just one not-so-small problem: China itself.

Perhaps you’ve seen the American television commercials for Samsung’s Galaxy S III smartphones: the ones that mock Apple customers for waiting in long lines and boasting about minute upgrades to the iPhone. That’s sportsmanlike behavior compared with the war that’s taking place between the two gadgetmakers in China, where Korea’s Samsung is firmly entrenched with 18% of the smartphone market, vs. Apple’s 12%. Samsung has indicated it will amp up an already large China-centric marketing and advertising budget, trying to build on what it sees as obvious momentum in the market, particularly in smartphones, arguably putting pressure on Apple to do the same. The Galaxy S III, which uses Google’s (GOOG) Android operating system, is outperforming expectations in China. Says a senior China-based executive at Samsung: “We want to remain bigger than Apple in China, and we believe we will.”

So far the companies’ epic patent infringement battle, playing out in courtrooms in the U.S. and elsewhere, has yet to reach China. Chinese officials say they haven’t been asked to investigate intellectual-property claims by either company. But Samsung, which currently gets about 30% of its overall revenue from China, is already seeking to preemptively engender goodwill there. It is building a huge flash-memory factory in the city of Xian, and company executives told the Korea Times that they are on a charm offensive, meeting with high-level Chinese government officials.

Samsung’s biggest edge over Apple, though, is the breadth of its product line. “The smartphone market is bifurcating into premium and low end,’’ notes Mark Newman, a senior technology analyst at Sanford C. Bernstein. Samsung is strong at both ends of the spectrum — the S 7562 model retails for about 1,998 renminbi, or $317 — while Apple plays in the high end alone. The iPhone 4s retails for about 4,500 RMB, or more than $700. Phone companies offer subsidies in exchange for service deals that can push the cost of the device down significantly over the life of the contract. But even with such discounts, an iPhone is an extraordinarily big upfront investment in a country where per capita annual income in 2011 was less than $5,000. (In urban China that figure rises to just under $10,000.) And so while the über-wealthy Chinese — those who shop at Louis Vuitton and buy BMWs — can handily afford an iPhone, most Chinese consumers, even those in the new middle class, remain intensely price-conscious.

Consider: Fortune interviewed more than 150 young Chinese in three different cities while they were shopping for smartphones. More than half echoed the sentiments of Wei Jinping, a 26-year-old office worker in the prosperous southern city of Guangzhou. “I like the iPhone, it’s very cool. But it is a bit out of my price range,” he said. “I need to make more money to buy one. Maybe in a couple of years.” By the time Wei is ready to step up, though, he may have already become a loyal customer of another brand.

MORE: Asia’s 25 hottest people in business

This issue is front and center for Apple — and for Wall Street. Toni Sacconaghi, Sanford Bernstein’s Apple analyst, estimates that 70% or more of the smartphones currently purchased in China sell for $300 or less. On a call for analysts earlier this year Sacconaghi asked Cook whether the popularity of cheaper phones limits Apple’s ability to gain market share in China. Cook challenged Sacconaghi’s data but didn’t offer his own estimates on low-end smartphones. He also evaded the analyst’s question, instead offering a pretty standard Apple line. “We’re going to stick to our knitting and make the best products,” Cook replied. “And we think that if we do that, we’ve got a very, very good business ahead of us.’’ (Apple declined to elaborate further on the issue for this story.) Cook’s commitment to high-end devices certainly helps Apple preserve its margins; its gross margin percentage in 2011 was 40.5%

Samsung is also able to reach a wider swath of Chinese consumers, thanks in part to its broad portfolio. In addition to phones and tablets and computers, it sells televisions, cameras, and even appliances such as microwaves. With this diverse product line, Samsung has relationships with tens of thousands of retailers and distributors, including venders in so-called Tier 5 cities, those with around 500,000 residents. The mom-and-pop stores may lack the glamour and prestige of the Apple stores, but for now Apple has only five company-owned stores in China’s major cities, and hundreds of licensed stores. Apple says it plans to open several additional flagship stores in the next few months but wouldn’t offer specific locations or dates.

If Yang Yanqing is worried about Apple, he doesn’t show it. The CEO of Chinese computer and phonemaker Lenovo thinks Apple — and Western companies in general — don’t know how to market to China’s first-time electronics buyers: the newlyweds buying a desktop for their home together or the young store clerk purchasing a phone with savings from a new job. “Even if I told them how to do that, they couldn’t,” Yang told Fortune in an interview in New York.

Yang has plenty of other reasons for his swagger. Lenovo outsells Apple in smartphones and trounces its American rival in traditional computer sales in its home market. And other homegrown competition is coming on strong in China. Shenzhen-based ZTE is in a dead heat with Apple for smartphone sales. Huawei, mostly known outside China as a maker of networking gear, is the No. 5 smartphone player, with 9% market share.

Analysts attributed some of the competitors’ recent gains to Apple consumers sitting on the sidelines in anticipation of the iPhone 5, which will begin selling in China before the end of the year. But the Chinese insurgents can’t be dismissed. They are all well capitalized and very aggressive. They’re all mimicking Samsung’s strategy of selling low-, medium-, and high-end phones. One ZTE model, for example, can be had for as little as 799 renminbi, or $125, without subsidies. And while these manufacturers are decidedly less cool than Apple, their brands are well recognized and respected in China. They aren’t tweaking their products for the local market: They are building them for the Chinese consumer. And so the Huawei Ascend P1 has a lush new display, which, as one Shanghai-based reviewer noted, really makes the colors on mobile games (a near obsession among many Chinese smartphone users) “pop.” China’s big three electronics makers also are making aggressive bids for the tablet market, where Apple is the current market-share leader. The iPad 2 sold only moderately well in China, and, again, like the iPhone, it is a one-size-fits-all solution. Lenovo, ZTE, and Huawei offer a range of tablet-like devices, from inexpensive models that look a bit like oversize phones to Lenovo’s new Yoga line, which combines a touchscreen with a full keyboard.

All of which make rumors of an iPad mini especially interesting in the Chinese market. Several reports suggest the new device will boast a seven-inch screen and retail in the U.S. for about $300. This lower-cost tablet could be the kind of entry-level device a big swath of China has been waiting for: a chance to take a bite of the Apple brand, without investing half-a-year’s salary. It might even suggest a willingness to develop entry-level products for the iPhone and computing lines. (It also isn’t unprecedented: Remember the iPod Shuffle?)

MORE: 6 Chinese social media superstars

Even if Apple doesn’t decide to delve any deeper into lower-end devices, it still has plenty of ways to juice its growth in China. The company has yet to secure a deal to run the iPhone on the China Mobile network. For years the two companies have been negotiating; every year the rumor mill churns that a deal between the two is imminent. There’s fresh speculation, once again, that the iPhone 5 will be the device that seals the deal. A source at China Mobile will say only that the two companies continue to have conversations, but that no final deal has been reached. But just as the availability of the iPhone on new carriers in the U.S. expanded Apple’s reach, a China Mobile deal would have a huge impact on Apple’s presence in China. The cellphone company has a 66% market share in China.

Meanwhile Apple is moving in smaller, smart ways to further immerse itself in the China market. The new iOS 6 operating system integrates popular sites in China like Sina Weibo, the microblog that’s more or less the equivalent of Twitter. And the Mac OS 10.8 upgrade includes a package of popular Mandarin sites, including Youku, a video destination. And while it lacks the massive reach of its Chinese competitors and Samsung, Apple has dramatically expanded the number of stores it permits to sell its devices; there are 11,000 places in China to buy the iPhone, up 138% from last year. The aggressive expansion plainly continues. One Shanghai suburb boasts two Apple licensee stores. “Business has been very good,” says Xie Li-jun, the manager of one of the stores.

Xie’s store is located near six college campuses, and there’s no question that young Chinese are drawn to Apple products for the badge value that comes from carrying one of the globe’s iconic devices. One Huawei executive recently confessed that this buzz “drives us a little nuts. I mean, we respect Apple and all, but please, we can compete with them.”

But there are no queues and jostling customers at retail outlets when Huawei releases a new phone or even when Samsung launches a new tablet, as there were outside the Apple store in Beijing earlier this year. (Another sign of Apple’s success: iPhone and iPod knockoffs are everywhere — there are even fake Apple stores that look eerily like the real thing.) Apple’s image and the excellence of its products have already made it potent in China in just a few years’ time, and the company doesn’t necessarily need to have the largest market share to make significant money in the market. Tim Cook doesn’t put a date on it, but make no mistake: As incomes grow over time here, and as the middle class continues to expand, China will eventually be Apple’s biggest market. And after that, well, maybe the sky is the limit.

–Reporter associate: Omar Akhtar

This story is from the October 29, 2012 issue of Fortune.

You May Like