They use FreeBSD and Darwin open-source code. Darwin is the core of MacOS with the XNU/MACH Kernel. So they are doing nothing wrong that Apple can sue them over it. The trick is writing the code that does what the Non-Open-Source code of MacOS does to run the Mac Apps.
> The trick is writing the code that does what the Non-Open-Source code of MacOS does to run the Mac Apps
And that is where the magic happens.
GNUstep has been trying to provide a useful open source alternative implementation of OPENSTEP for more than 20 years now I believe. I don’t see that happen to be honest.