"Beneath the appealing, easy-to-use interface of Mac OS X is a rock-solid foundation that is engineered for stability, reliability, and performance. This foundation is a core operating system commonly known as Darwin. Darwin integrates a number of technologies, most importantly Mach 3.0, operating-system services based on 4.4 BSD (Berkeley Software Distribution), high-performance networking facilities, and support for multiple integrated file systems.
Darwin 1.4.1 is the UNIX-based, open-source foundation of Mac OS X. It is based on FreeBSD and Mach 3.0 technologies and provides protected memory and pre-emptive multitasking. This release corresponds to the release of Mac OS X 10.1."
If a company decides to open source a project that is not directly related to their business, then they are gaining an advantage - now their code can be vetted and improved by the open source community and they can spend less engineering time on the project themselves while they focus on their real business.
Where is this magical "open source community" which is eager to examine dull business code? It's a myth. The Debian project shipped a broken PRNG for ages, and that is a popular project.
Who ever said 'dull business code'? Take Twitter Bootstrap for example - It started off just so Twitter could iterate faster on internal applications and not worry so much about styling - Now they've open sourced it and others can contribute. It does nothing to better their business model.