Just 18 years ago Apple flirted with bankruptcy. Now it's trying to become America's first $1 trillion company.

Steve Jobs helped return Apple (AAPL) to greatness by churning out innovative products like the iPod and iPhone that consumers fell in love with.

Since taking over for Jobs in August 2011, current Apple CEO Tim Cook has doubled the tech behemoth's earnings and profits, thanks largely to strong sales of the latest generations of the iPhone. Cook has also plunged the company into the world of wearable technology with the Apple Watch, which started taking pre-orders last week. It's already back ordered until June.

But the key to Apple's future growth may lie in the tech giant's less sexy software business.

Related: Apple stock is making regular Americans rich

Software represents "the crown jewel" embedded in Apple's products and services that will ultimately help lead it to becoming the world's first $1 trillion company, FBR Capital Markets analyst Daniel Ives wrote in a research note published on Thursday.

Ives gives Apple an "outperform" rating -- Wall Street's version of an A+. He thinks the stock will go to $185 (it's currently at $125). If he's right, it would carry Apple over the $1 trillion threshold, a fete even rarer than winning the triple crown. But keep in mind Ives has the most bullish price target among all Apple analysts tracked by FactSet Research.

Related: Will Apple soon be worth $1 trillion?

Secret sauce: Apple's software -- namely its iOS mobile operating system -- is the "secret sauce" to the company's future because it helps insulate it from "fickle consumer preferences" that could hurt device sales, Ives said.

The software serves as a platform for developers to launch millions of apps that make Apple's devices more useful for consumers and businesses alike. In other words, the software is the "glue that binds" the iPhone, iPad and iPod together, Ives said.

Related: Dow tumbles 250 points as stocks nosedive around world

World's largest companies: Valued at $728 billion, Apple is already the world's most valuable company. The next closest companies aren't that close at all: ExxonMobil (XOM) ($363 billion), Warren Buffett's Berkshire Hathaway (BRKA) ($347 billion) and Microsoft (MSFT) ($339 billion).

There is precedence for a trillion dollar valuation. PetroChina (PTR), a Beijing-based oil and gas company, briefly surpassed that threshold back in 2007. Now it's "only" worth $369 billion.

iTrillion: It's far from a guarantee that Apple will achieve trillion dollar status, especially in the next 12 months. The company could stumble badly or be caught off guard by a new trend in the consumer products world. The average 12-month price target on Apple is $140, implying a valuation of roughly $815 billion.

Yet Ives isn't alone in his iTrillion call. Carl Icahn, the billionaire who is one of Apple's most vocal shareholders, believes the company is worth over $200 a share.

Last month Apple bull Brian White, an analyst at Cantor Fitzgerald, boosted his price target on Apple to $180, signaling a $1 trillion valuation.