Marissa Mayer got a nice compensation package because she did well by Yahoo investors: she managed to trick Verizon into paying real money to buy the hulking wreck of Yahoo.
If you start out thinking that Yahoo could ever possibly have been saved in any alternate universe, you can get all-kinds of angry or disappointed in Mayer's performance. But if you see Yahoo for what it was, you realize she really did arrange the best possible deal that Yahoo shareholders could have hoped for.