It's very rare that you see acquisitions work out like this. Apple traded away about 13% of their 1996 market cap to buy NeXT, and then allowed NeXT's leadership to take over and run the place. Most M&A stories like this usually result in massive underperformance for shareholders. Instead, Steve Jobs turned NeXTSTEP into OS X and iOS, driving an incredible turnaround.
People like to point out that this merger was different because of Steve Jobs and his history with Apple, but I don't think that's so obvious. Neither Apple nor NeXT were strong companies at the time, and Apple's culture had drifted considerably since Jobs was fired in 1985.
For anyone who has been involved in a big acquisition integration, it can be like pulling teeth to get a buyer to properly adopt the target's technology. There are always barriers from the junior engineer all the way to the CEO. While it certainly helped that Jobs was the original founder, even that was no guarantee of success. Jobs had learned a lot running NeXT and Pixar, but that was not obvious at the time. I imagine there was a lot of internal resistance within Apple.
This acquisition probably would have failed miserably anywhere else, and yet Jobs and Apple made it one of the best ever.