Former Microsoft (MSFT -1.27%) CEO Bill Gates is in a two-man race for the title of world's richest man. Pitted against Carlos Slim, the Mexican telecom mogul, in many cases the mundane gyrations of the market separate these two billionaires. According to Forbes' List of the World's Billionaires as of this writing, a mere 0.6% puts Mr. Slim in the lead.

You'd think that with this staggering amount of wealth -- nearly $80 billion -- Bill Gates would have led a flawless career. Well, that's simply wrong. In August 1997, a Bill Gates-led Microsoft made one of the biggest mistakes in tech -- a mistake that continues to haunt Microsoft investors to this day. It started, innocently enough, with an investment to fellow tech company Apple (AAPL -1.22%).

A tale of two companies
Most know Apple as a tech juggernaut, but it wasn't always that way. The '90s were tough on the Cupertino-based company. Throughout the first half of the decade, net income had dropped from $475 million to $424 million, and then the bottom fell out. Fiscal 1996 witnessed a top-line decline of 11.1%, followed by a subsequent drop of 28%. Net income was even worse. A company that was previously profitable swung to net losses on the back of falling revenue, restructuring costs, and in-process R&D expenses -- although it is prudent to mention the R&D expenses were for NeXT, the transaction that brought Steve Jobs back to the company.

Meanwhile, nine hours due north in Redmond, Wash., there was no company with more buzz than Microsoft. The company's signature product, the Windows operating system, is the most dominant force in the world of computing. For perspective, Microsoft grew its top line an astonishing 19-fold from fiscal 1990 to 2000 -- from $1.18 billion to nearly $23 billion during that time span.

But everything wasn't roses in Microsoft land; any company that grows that quickly is bound to make some enemies. And while it's easy to forget now due to his humanitarian record, Bill Gates was despised in many quarters. Many among the open-source, Linux crowd saw him as the face of the corporatization of the Internet, an area many felt should be free and open to the world.

In addition, the U.S. government was becoming increasingly worried about Microsoft's dominant position and what it considered anti-competitive behavior. Although it would eventually end up before the Supreme Court in the early 2000s, the government had issued inquiries as early as 1991. What Bill Gates did to improve his image was the worst business move he's ever made.

Meaningful Partners
Meanwhile, back at Apple things were falling off the rails. CEO John Sculley departed in 1993 after a series of missteps – among them, stripping Steve Jobs of all leadership responsibilities (Jobs left Apple very quickly thereafter). Things got worse: the next two CEOs – Michael Spindler and Gil Amelio – led the company through the failed Newton and saw the stock hit a 12-year low. By 1997 the company was desperate for more than just a savior; it was also in desperate need of cash. They got both of those things.

A newly returned Steve Jobs took the stage at a MacWorld event. Behind him, a large screen read "Meaningful Partners" in black and white. What happened next changed the course of technology as we know it.

Mr. Jobs went through many facets of Apple's new partnership with Microsoft – including a Patent Cross License, Microsoft Office on Macs, an inclusion of Microsoft's Explorer Browser for Macs and Java Collaboration. But the breathtaking announcement was that Microsoft was investing $150 million to buy Apple's stock at the current market price. Initially eliciting boos from the attendees, Jobs quickly turned them to cheers when he stated there was a three-year holding period and no voting rights.

Ashton Kutcher as Jobs. Perhaps Microsoft investors want to watch another Kutcher movie: The Butterfly Effect. Source: Endgame Entertainment

A ruse of an investment
Via satellite, Gates addressed the Apple crowd with the pleasantries and respect befitting a non-competitor. He was magnanimous and stressed it was a true partnership … and a clear departure from prior hostilities between the two companies.

And there was a reason for that. The investment was a ruse designed to elicit goodwill from both a zealous U.S. government and the open-source crowd. In Gates' mind, the best outcome was that Apple would overcome its small downturn and become slightly competitive; worst case, Apple would still fail and Microsoft gets a $150 million investment in PR for helping a competitor.

But that isn't what happened. Jobs decided to ruthlessly focus the company. Many projects were cut with the plan of making Apple a leaner and overall better company. The company's next product, the iMac, was a huge success giving Apple time to recover from its down years. By fiscal 1998, Apple was profitable again and on firmer footing.

But it was more than just the money. Apple was on the ropes. Microsoft essentially made a promise to provide software, essentially guaranteeing that Apple's line of products would not go obsolete. That promise would haunt Microsoft in the decade to come. And while many note that Apple had a cash pile of nearly a billion dollars at the time of the loan, the company had lost respect from the greater computing community.

About Microsoft's "missed decade"
If you ask investors about Microsoft, the refrain is all too familiar. You'll hear terms like "missed the boat on mobile," or "lost decade." And that's true. Microsoft remained too tethered to PC sales, now in a state of decline.

But in a weird butterfly effect way of thinking, this new computing paradigm was perfected by Apple after building upon the successes of BlackBerry – formerly Research In Motion. While then-CEO of Microsoft Steve Ballmer laughed at the iPhone, Apple was busy working with developers to perfect the model.

And it's been wildly successful. Last year, Apple sold $123 billion of mobile devices -- iPhones and iPads -- that aren't dependent on Microsoft's operating system. For reference, that's more than 150% of Microsoft's last annual report of $78 billion.

Final thoughts
While one can never have certainty in alternate-reality scenarios, it's safe to say that Apple benefited greatly from Microsoft in a time when the company needed help. Decades later, by refining the mobile experience Apple has done a great deal to provide headwinds to Microsoft.

And while nobody can fault Bill Gates for not anticipating this outcome, it's interesting to ask two questions: "Would Steve Jobs have done the same thing if he had been in Bill Gates' position?" And "How much more than Carlos Slim would Bill Gates be worth right now if Apple didn't exist?"