OS X is derived from NeXTSTEP, first released in 1989 and based on 4.3BSD-Tahoe. Meanwhile, this was updated to 4.3BSD-Reno and ported to the x86 as 386BSD, from which NetBSD was forked in early 1993; it was subsequently reorganized to become FreeBSD in late 1993. NeXTSTEP and OS X later imported a few system components from FreeBSD, while replacing others, particularly replacing parts of the kernel with Mach.
The first release of FreeBSD was 30 years ago, OS X a little over 20.