Apple, for the first time in years, is hearing footsteps.

The maker of iPhones, iPads and iPods has never faced a challenger able to make a truly popular and profitable smartphone or tablet — not Dell, not Hewlett-Packard, not Nokia, not BlackBerry — until Samsung Electronics.

The South Korean manufacturer's Galaxy S III smartphone is the first device to run neck and neck with Apple's iPhone in sales. Armed with other Galaxy phones and tablets, Samsung has emerged as a potent challenger to Apple, the top consumer electronics maker. The two companies are the only ones turning profits in the highly competitive mobile phone industry, with Apple taking 72 percent of the earnings and Samsung the rest.

Yet these two rivals, who have battled in the marketplace and in the courts worldwide, could not be more different. Samsung Electronics, a major part of South Korea's expansive Samsung Group, makes computer chips and flat-panel displays as well as a wide range of consumer products including refrigerators, washers and dryers, cameras, vacuum cleaners, PCs, printers and TVs.

Where Apple stakes its success on creating new markets and dominating them, as it did with the iPhone and iPad, Samsung invests heavily in studying existing markets and innovating inside them.

"We get most of our ideas from the market," said Kim Hyun-suk, an executive vice president at Samsung, in a conversation about the future of mobile devices and television. "The market is a driver, so we don't intend to drive the market in a certain direction," he said.

That's in stark contrast to the philosophy of Apple founder Steve Jobs, who rejected the notion of relying on market research. He memorably said that consumers don't know what they want.

Nearly everything at Samsung, from the way it does research to its manufacturing, is unlike Apple. It taunts Apple in its cheeky advertisements while Apple stays above the fray.

And the Korean manufacturer may even be putting some pressure on Apple's world-class designers. Before Apple released the iPhone 5, which had a larger screen than earlier models, Samsung had already been selling phones with even bigger displays, like the 5.3-inch screen Galaxy Note, a smartphone so wide that gadget blogs call it a phablet.

Guess who spends more on R&D

Samsung outspends Apple on research and development: $10.5 billion, or 5.7 percent of revenue, compared with $3.4 billion, or 2.2 percent. (Samsung Electronics is slightly bigger than Apple in terms of revenue — $183.5 billion compared with $156.5 billion — but Apple is larger in terms of stock market value.)

Samsung has 60,000 staff members working in 34 research centers across the globe, including, Russia, Britain, India, Japan, Israel, China and Silicon Valley. It polls consumers and buys third-party research reports, but it also embeds employees in countries to study trends or merely to find inspiration for ideas.

Designers of the Galaxy S III say they drew inspiration from trips to Cambodia and Helsinki, a Salvador Dalí art exhibit and even a balloon ride in an African forest. (It employs 1,000 designers with different backgrounds like psychology, sociology, economy management and engineering.)

"The research process is unimaginable," said Donghoon Chang, an executive vice president of Samsung who leads the company's design efforts. "We go through all avenues to make sure we read the trends correctly." He says that when the company researches markets for any particular product, it is also looking at trends in fashion, automobiles and interior design.

Hangil Song, a Samsung product designer, described a visit to the Marina Bay Sands resort in Singapore, where he said he was amazed by the views of the sky, the cityscape and the water. He wanted to create an effect where water was overflowing from the screen. As a result, taps and swipes on the Galaxy S III's phone screen create a unique ripple effect.

The genesis of the wide Galaxy Note phone reflects that same kind of consumer research. From focus groups and surveys, Samsung found that many respondents wanted a device that was good for handwriting, drawing and sharing notes. Asian-language speakers, in particular, found it easier to write characters on a device using a pen than typing. Those insights led to the Note, a smartphone that comes with a digital pen.

In courts, jury members have said some of Samsung's research appears to comes closer to copying. Apple sued Samsung in U.S. District Court last year for patent infringement and won a $1 billion judgment. One of the most explosive pieces of evidence was a detailed report breaking down each hardware and software feature of the iPhone and how each compared to Samsung phone features.

Samsung says studying the market helps it build confidence for the wireless carriers that its mobile devices will sell well. That, in turn, persuades the carriers to aggressively sell Samsung phones and tablets. "That's kind of the secret sauce," said Kevin Packingham, chief product officer of Samsung.

'Terrific partner'

Daniel Hesse, Sprint's chief executive, called Samsung a "terrific partner" because of its willingness to work with the carriers on the creation of phones. For carriers, that could be a refreshing alternative to working with Apple, which completely controls the design of its iPhone's hardware and software. "They work with the carriers, they want to hear from you what you want, they don't tell you what it's going to be. It's very two-way," Hesse said.

Samsung differs in one other important way. It remains a manufacturer, while Apple contracts out the assembly of its devices. Horace Dediu, a mobile industry analyst at Asymco, said that historically, it built its business around producing and selling components to other manufacturers, including Apple, Sony and Hewlett-Packard. While Samsung had been making and selling consumer electronics in Korea and developing markets for decades, these relationships taught it a lot about competing with — and beating — the biggest names in the industry.