$150 million, not $5 billion. Microsoft bought 150 million dollars worth of non-voting shares as part of a patent licensing agreement, and also agreed to produce MS Office for OS X for at least 5 years (this was the important part, since many big software vendors had not yet committed to port their code to the new OS), and Internet explorer would be bundled as the default browser for 5 years (I think it was 5 years).
Apple was a multi-billion dollar company with 1.2 billion in cash at the time. It was in trouble financially, but it probably could have survived without that $150 million.
"Take that, you hostile sons-of-bitches!" -- James Coburn, in the finale of _The_President's_Analyst_