Is macOS mostly closed source? I was under the impression that macOS is closed source. But this opensource domain says otherwise. Is macOS open source or partially open source? I'm confused now.
It is more accurate to say that macOS, for the most part, is based on open source code.
There is a ton of open source technologies used in macOS from the core of the kernel to how it renders graphics to even Applications (like Chess).
They even have a number of Open Source Projects that are available to the community.
Folks generally assume that &quot;Open Source&quot; means you have access to the code and you should be able to download it and hack away to your heart's content (i.e. RedHat/CentOS Linux).  That's not always the case.
It's all about the license
It comes down to licensing and there are basically three types:

GPLv3 (Current version of GNU Public Licensing, implemented in late 2005)
GPLv2 (GNU Public Licensing)
BSD (Berkley Software Distribution)

The general difference between them is that GPL says &quot;you get, you give&quot; where as the BSD license says &quot;take and do whatever.&quot;  FOSSWire has further reading on this.  GPLv2 was a &quot;loose&quot; license similar to that of BSD
If you've noticed, everything in macOS is under the BSD or the older GPLv2 license .  This means they can take the code, incorporate it into their proprietary product (macOS) and not have to give back a single line of code, explain their changes, or reciprocate any rights back.
For instance, Bash, which is included with macOS is &quot;stuck&quot; at version 3.2.57 from 2007.
$ bash --version
bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin15)
Copyright (C) 2007 Free Software Foundation, Inc.

Version 3.2 was the last version to be covered under the less restrictive GPLv2.  Bash 4.0 went to the more restrictive GPLv3. (This is also why you don't see Bash even included with FreeBSD and must be installed by the end user).
Can you update Bash to a newer version?  Sure.  Apple just can't (and won't) distribute macOS with it due to the license restrictions.
But Darwin is open source.
Yes it is.  But Darwin is not macOS; it's the core of macOS.  It's the command line without the GUI.  All of the the goodies that makes macOS...well macOS, is nowhere to be found in Darwin.
Bottom Line....
macOS isn't open source but the core, Darwin, is.