That's not really true. OSX is a derivative of BSD if I recall correctly. Linux is based on it's own code base. Some software may be written to be compiled on both systems through makefiles, but the actual codebase of the kernel is different.
They both descend from Unix; BSD is a Unix derivative; Linus used Unix in his creation. Perhaps ‘underlying’ was the wrong word, I’m not a stickler for strict accuracy - too old for that crap.