SAN FRANCISCO (MarketWatch) — Sometimes it’s hard to fathom just what Steve Jobs has done at Apple Inc. during the 14 years since he rejoined the company as chief executive. You could call it remarkable, but would come up short.

Sure, it was a tour de force of visionary management and human force of will. But it was also world-changing, a testament to what a determined and passionate person can achieve when he or she knows to compromise on even core principles, when the time for compromise is right.

Now that Apple’s products have a rising share of the PC market and a leading share of huge, fast-growing markets such as smartphones and electronic tablets, it’s easy to forget what Jobs had to do to rescue Apple AAPL, +1.50% from its role as a niche player teetering on the brink of existence, as it was in 1997.

What to expect at next Apple event

Before Jobs could transform the markets for music, phones and PCs (a second time), Jobs had to save his company. To do so, he did what had been, until the very moment he announced it, unthinkable: He struck a deal with Apple’s fiercest rival.

On Aug. 6, 1997, Jobs appeared at the Macworld conference in Boston and revealed to the Apple faithful that the company was entering into a strategic partnership with Microsoft Corp. MSFT, +1.48% , its longtime technology enemy.

Jobs was visibly nervous on stage, taking a drink of water before saying that Apple “needs help from other partners … and relationships that are destructive are no help to anybody in this industry today.”

Needing some help

Apple certainly needed a lifeline at the time. As Jobs spoke, the company was in its fourth consecutive quarter in the red, a period when it lost more than $1 billion in aggregate. Sales were stagnant even as the tech world boomed. At the same time, Microsoft was flush with cash as its Windows 95 operating system gobbled up PC market share like a vacuum cleaner.

Jobs told his audience that Apple’s relationship with Microsoft was one that “hasn’t been going so well, but had the potential to be great for both companies.”

To the disbelief of the Apple developers in the audience, he then announced a new partnership with the software giant. Many in the crowd booed.

First, Jobs said the two companies had signed a broad five-year patent-licensing agreement, ending the legal hostilities. Apple and Microsoft also agreed to work together to make sure their versions of the Java programming language were compatible.

At the time, Apple was in court against Microsoft, having sued Gates and company for patent infringement, accusing Microsoft of copying the Apple desktop look and functions that helped make Windows 95 such a hit.

The agreement took away the cost of all that litigation. Jobs’s timing also was impeccable: He knew that Gates and Microsoft, which had been sued by the U.S. Justice Department for monopolistic practices, needed a public-relations win. Settling the lawsuit would prevent government antitrust attorneys from arguing that Microsoft had ripped off Apple’s designs for its biggest-selling piece of software.

Next, Jobs said that Microsoft also had agreed to release an Apple version of its flagship Office product whenever it released a Windows version, again for five years. That agreement gave Macintosh lovers another reason to stick with Apple’s platform, even as Microsoft software applications (and licenses) were proliferating like rabbits in the business and consumer markets.

Shouts of ‘no!’

Jobs then dropped another bomb, sharing the biggest concession that Microsoft forced out of Apple: making Internet Explorer the default browser on the Macintosh platform. The announcement was roundly and loudly booed, twice. Several members of the audience shouted “no!”

Remember, this was a Jobs keynote, an event that’s now regarded by some in the industry as something akin to a religious sermon.

“We think Internet Explorer is a really good browser, and we think it’s going to make a fine default browser” on the Macintosh operating system, Jobs added, to zero applause.

But Apple’s chief assuaged the faithful by saying that users would also have the freedom to choose other browsers, “because we believe in choice,” assuring that Apple would indeed be shipping other browsers. He knew that Apple could have a competitive browser of its own — if the company could stay alive long enough to develop one.

Given that Apple had been racking up losses, Jobs couldn’t be sure just how much time was left. He had just gotten himself reinstated as Apple’s leader, after all, in no small measure because of the Microsoft deal.

Then Jobs revealed how much Gates and Microsoft would be paying Apple in return for ending the long feud: $150 million. That’s how much Microsoft was investing by buying shares of Apple at market prices.

Microsoft agreed not to sell the shares for three years, thereby helping to put a floor under Apple’s stock price. They were nonvoting shares, so Jobs kept control of decision-making. Gates gained some goodwill, as well as a significant minority stake in a company whose market cap would end that quarter at $2.5 billion.

Turn enemies into allies

On Aug. 10, 2011, exactly 14 years and four days after Jobs announced the deal with Microsoft, Apple’s market capitalization hit $365 billion — making it the world’s most valuable company. Today, it’s worth $375 billion. For those of you who are counting, that’s more than a 100-fold rise in shareholder value.

Meanwhile, Microsoft’s market cap sits at about $210 billion, less than half of where it topped out in early 2000, yet not far from its value at the time of the Apple deal.

It’s easy to see now that Jobs got the better part of the bargain. It’s perhaps more useful to hear what he told the audience that day — just after he showed them a videotaped speech from Gates, who explained why he, the Microsoft founder, believed the Macintosh was worth supporting.

Gates noted that 8 million Microsoft users were on the Apple platform, and he talked up the forthcoming product, called Mac Office 98, saying it took advantage of the unique capabilities of the Mac. He added that “in many ways it’s more advanced than what we’ve done on the Windows platform.”

For tech consumers, amen to Gates’s acknowledgment of Apple ingenuity and his foresight in helping to save the company. From the perspective of Microsoft shareholders, of course, Gates would have served them better by buying Apple outright (and perhaps firing its workers and burning its buildings down).

Jobs, for his part, gave the crowd a lesson that could have come straight from the Tao Te Ching or other Eastern texts that he reportedly reads: “We have to let go of the notion that for Apple to win, Microsoft has to lose,” he commented.

The lesson, which I’ve also read in a few fortune cookies over the years, can be put this way: “The best way to rid yourself of an enemy is to turn them into an ally.”

The strategy worked well for Steve Jobs and for Apple shareholders. To see a video of Jobs’s 1997 keynote, click here.