Every year Apple publicly shares the source code of the OS X base macOS, the Darwin. It is an open operating system, based on Unix BSD and Mach. It is nothing more than the core (core) of Ma's desktop operating system.
This week Apple released the source code for the macOS Sierra 10.12 core (released in mid-September). It is worth noting, however, that most of the desktop operating system remains closed (ownership), as it always has been.
The components of Darwin are used by a minority of Apple users, but they are essential in the interoperability of macOS with the Unix / Linux world, aiming at carrying common programs and offering package management for the platform.