"Apple famously painted themselves into a corner with the unmaintainable spaghetti code that was OS9. They went - cap in hand - to Berkeley University and asked if they could use BSD as the underpinning of OSX....."
"Classic" MacOS was awful. I won't defend it. I thought the worst "feature" was their insistence on claiming cooperative task switching was "multitasking". (Multitasking, the OS gives each program a timeslice, when it's done it's done... cooperative task switching, which is NOT multitasking, it's up to the app to yield it's time, making a call saying "OK I'm done"... if it never yields, the ENTIRE system locks solid. Which, along with having no memory protection, is why these systems locked up so damned often.)
What actually happened here was... Apple "deposed" Steve Jobs. Jobs went and started Next computers (NeXT always seemed to be capitolized differently every single time, even on the NeXt computers and literature themselves.) *They* took Mach microkernel + BSD and developed Objective C programming language, as well as a very modern (for 1985) object-oriented GUI. Jobs was convinced if the OS and computer were nice enough, people would pay like $10,000 for them. So, fast forward a few years -- next was on the ropes, but so was Apple due to the crapulence of OS9. Apple actually went cap in hand to buy up NExt and reinstall Jobs as CEO of Apple, OSX is a direct decendent of NextStep. This is why so many functions on it start with "NS".