So it looks like mostly FreeBSD and a little of the old Mach
Well, if you call the osfmk directory of the XNU source a little, I guess it's "a little of the old Mach", although a fair bit of that code comes from NeXT and Apple as well.
I think NetBSD was used as a means for porting between architectures more than a literal inheritance.
Well, let's look at the libc source (the libc part of libSystem):
$ fs . | xargs egrep -h '\$NetBSD:' | wc -l
$ fs . | xargs egrep -h '\$FreeBSD:' | wc -l
("fs" is a script that finds source files and prints their names to the standard output). The files it found with "NetBSD" in them were ./gen/FreeBSD/fmtcheck.c, ./gen/FreeBSD/lockf.c, ./gen/FreeBSD/stringlist.c, ./gen/NetBSD/utmpx.c, ./include/arpa/tftp.h, ./include/FreeBSD/nl_types.h, ./include/getopt.h, ./include/limits.h, ./include/NetBSD/utmpx.h, ./include/paths.h, ./include/search.h, ./include/stddef.h, ./include/stringlist.h, ./include/util.h, ./include/wchar.h, ./include/wctype.h, ./stdlib/FreeBSD/getopt.c, ./stdlib/FreeBSD/getopt_long.c, ./stdlib/FreeBSD/hcreate.c, ./stdlib/FreeBSD/tdelete.c, ./stdlib/FreeBSD/tfind.c, ./stdlib/FreeBSD/tsearch.c, ./stdlib/FreeBSD/twalk.c, ./stdlib/NetBSD/strfmon.c, ./string/FreeBSD/strndup.c, ./string/FreeBSD/wcscat.c, ./string/FreeBSD/wcscmp.c, ./string/FreeBSD/wcscpy.c, ./string/FreeBSD/wcscspn.c, ./string/FreeBSD/wcslcat.c, ./string/FreeBSD/wcslcpy.c, ./string/FreeBSD/wcslen.c, ./string/FreeBSD/wcsncat.c, ./string/FreeBSD/wcsncmp.c, ./string/FreeBSD/wcspbrk.c, ./string/FreeBSD/wcsspn.c, ./string/FreeBSD/wmemchr.c, ./string/FreeBSD/wmemcmp.c, ./string/FreeBSD/wmemcpy.c, ./string/FreeBSD/wmemmove.c, ./string/FreeBSD/wmemset.c, and ./util/fparseln.c.
The "NetBSD" and "FreeBSD" directory names are somewhat historical - for example, the 10.8.4 version of getopt_long() comes from NetBSD.
of course there are probably newer bits of FreeBSD used that are only known internally to Apple.
And other bits only known to people who download the open source bits and look at them. :-)
Then the timeline proceeds with Mac OS X as what appears to be where all of the development is taking place (including inheriting from FreeBSD), with Darwin and OS X Server only ever taking from OS X like mirrors. Then suddenly in 2006 this model changes and the OS X 10.5 beta inherits from Darwin 9.0 beta, when OS X 10.5 and Darwin 9 mature the model goes Darwin -> Mac OS X -> Mac OS X Server...
That's the timeline, not reality. Darwin was always produced by taking parts of OS X and making them available in source form; the model didn't change with Leopard.
Then in 2007 during the OS X 10.7 beta the model changes again when the server branch is eradicated all together and gets integrated into OS X and OS X gets integrated into Darwin so the model goes OS X -> Darwin again but without the server.
Yup - with Lion, Apple stopped shipping separate server and client versions of the OS, and, instead, shipped an add-on package containing the applications that were formerly bundled with the server version but not with the client version.