Apple's history and problems are different. Its board is subservient -or was under Jobs - to the CEO, but under Cook there does seem to be more balance (though you'll note Levinson is non-executive chairman, possibly repeating the Fiorina mistake and likely leading to Cook's termination). And recall that Steve Jobs was almost fired a second time due to stock option backdating (every other CEO I followed who did this was fired), so Apple also has showcased the problems associated with a powerless board.
But with Apple, once you lost someone who had product passion running the company, the firm tended to flounder. John Sculley was a soda pop executive who wasn't even in the technology market. He was replaced by Michael Spindler out of sales (note Steve Jobs compared this to Ballmer running Microsoft), who was replaced by Gil Amelio, who appeared to have no real clue what to do with the company.
Steve Jobs comes back, turns the company into the most valuable company in the world. So what made him successful where the others failed?
There are probably more books on Jobs than on any CEO and Carmine Gallo actually has published a series of books that teaches you how to do what Steve Jobs did. But at the core of this are three things: a massive passion for the product, a willingness to do whatever it takes to win and the ability to sell the product to an audience of influencers. These are traits the other guys lacked.
With regard to product passion, you can point to Apple's marginal products during Steve Jobs' reign, like the Apple TV. Steve didn't like TV, thought it was stupid. Without the passion it wasn't resourced and while it is good, it is not the iPod.
On doing whatever it takes, when he became convinced that HP might have a better MP3 player he called Carly Fiorina up, convinced her he was going to give her the iPod market, and then locked HP out of MP3 players until Apple owned it. Ethical it wasn't, but it showcased he was willing to do whatever it took to win.
On product presentation there simply was no one better. As Gallo points out in his "Presentation Secrets of Steve Jobs," Steve personally assured every major part of the pitch and only stopped doing that when his health no longer allowed it.
These are the skills that made Jobs unique and put Apple at the top of the pile and Cook has none of them. It constantly amazes me to hear the same folks say that Steve Jobs was irreplaceable and argue that Cook, a very different kind of person, will easily replace him, particularly given Apple's past history without Jobs.
We have another example. Microsoft was formed on the idea of Paul Allen and the drive of Bill Gates. Ballmer was hired to be their go-to guy. He doesn't code and doesn't have a passion for software, but like Cook, he does love his company. When Bill lost his passion, he wisely stepped down and even tried to backfill his unique skills with Ray Ozzie, but Ozzie and Ballmer apparently couldn't team (Ballmer simply isn't going to see the world the way Ozzie does) and Ozzie was forced out.
Now the sad thing about Steve Ballmer is Bill Gates clearly saw what was going to be a problem and likely has the skills to properly supplement Steve, granted with someone else (he isn't coming back - interesting he had to say this) and ensure his success, but it would likely mean putting Steve in a subservient role to whomever set strategy and drove product. More similar to the way it was between Bill and Steve and he simply doesn't want to ask Steve to step back. The end result is that Microsoft is a shadow of what it could be and Bill actually has less resources to do what he does have a passion for because his funding still largely comes from Microsoft.
Now how much do you want to bet that when Ballmer steps down, they don't put in someone with a passion for software? In short, Ballmer's failure is Gates' fault and, I expect, in his heart he knows this. Steve likely knows he isn't working out, but doesn't know what to do other than step down and doesn't want to appear a failure. His closest friend needs to step up.
IBM was designed to survive centuries and has a CEO grooming process that assures a skill set. And the CEO job is tightly defined so that skill set works. What is interesting is the founders, Thomas Watson Sr. and Jr., put in a ton of effort to ensure that there was a process to select the next CEO and to keep the company focused. Interesting enough, as Sam Palmisano, IBM's last CEO, pointed out, the only time IBM has gotten into trouble was when it strayed from this process and Louis Gerstner's biggest contribution was setting up Palmisano to reinstate it.
That isn't to say IBM doesn't make repeated mistakes, but when it stays with a process that works, it seems to make less of them.
Wrapping Up: Lessons Learned
You likely won't be or hire a CEO or be on a board. However, think of the last person you hired and fired. Did you really think about what you did wrong? Was it bad selection, bad management, bad oversight or simply a bad situation? What skills and personality attributes are needed by not only those who work for you, but in your own job and have you assured training or support to close those gaps? These are all things you can either better anticipate or fix, assuring you won't have to go through the pain of firing or being fired again. Firing people isn't fun and it is often easier to fix an employee problem than to replace the employee (because in the latter case you tend to get a bunch of new issues to deal with).
Rather than focusing on shooting someone when there is a problem, realize that every failed CEO at all of these companies, at least for a time, was doing the best job they could, they just weren't getting the needed support, direction or they just weren't right for the job. At HP, Fiorina and Hurd were good choices, but badly managed. Apotheker was a bad choice, and Whitman looks to be a good choice and well managed. Nothing says you have to go through this learning experience, so why not jump to the good practice directly? And yet folks don't.
Another way of putting this is that if you focus on understanding why a problem occurred, you'll improve even if you are shot. If you focus on shooting people, you'll likely get shot more often yourself. Think about it.