CEOs get the big bucks because they are better than everyone else at taking credit for business success irrespective of how much control they actually had over the factors contributing most to those successes[1]. They've also been the most effective group at raising the baseline replacement cost of their position. This limits the amount that can be saved by booting a CEO for a cheaper option. So there's a feedback loop at play, when the business succeeds, the CEO gets a raise, and when it falters, market forces prevent the CEO from getting a pay cut (and often still seem to necessitate, or at least "justify", a raise in the face of declining business).
[1] I'm not saying that their impact is never high, but CEOs are paid as if it is always high, and that's essentially been demonstrated by economists not to be the case, particularly with large complex organizations.