The history of Mac OS X is pretty well known by most people. Apple's Mac OS operating system was breaking apart at the seams during the second half of the '90s; it lacked several modern features that had already become standards on most of its competitors, such as protected memory and preemptive multitasking. In addition, Apple was facing strong competition out of Redmond, which had enormous success with its Windows 95 release, but was also showing the future of Windows with the written-from-scratch Windows NT.
After an impressive list of failed projects to either modernise the existing Mac OS, or to write a new one from scratch, Apple realised it had to buy an existing operating system to serve as the base for Apple next-generation Mac OS. Several options were considered, including a partnership with Microsoft to use Windows NT, but in the end Apple eyed a young but promising company based in Menlo Park, California: Be, Inc.
Be, Inc. was founded by ex-Apple CEO Jean-Louis Gassée, and had produced the BeOS, an advanced but unproven operating system. The deal came close, but Gassée wanted far too much money for Be, and the deal did not work out, and consequently, Be faded out. It is reported that even though Be was valued at about 20m USD, the offers flying back and forth between Apple and Be ran into the hundreds of millions.
Steve Jobs, who was heading NeXT at the time, contacted Apple, and pitched the NEXTSTEP heavily to Apple, claiming it was technology proven in the market - unlike the young and untested BeOS. The pitch was successful, and Apple decided to use NEXTSTEP (by then renamed to OPENSTEP) as the basis for its next-generation operating system.
Several developer preview releases, designated as Rhapsody, made their way into tester's hands, but the first official, final version released to the public was Mac OS X Server 1.0, on January 5th, 1999 (it didn't start shipping until March of that year, however).
Weirdly enough, though, Mac OS X Server 1.0 was not the direct precursor to the desktop variant of Mac OS X; both were developed alongside one another, but would share improvements. Several Mac OS X developer preview releases were released over the course of 1999, and as soon as Mac OS X 10.0 was released early 2000, version numbering schemes between Mac OS X' client and server variants were synchronised.
The rest is history, as they say.