It's not something they can avoid. These companies were often dead before any of those changes were made; and none of those changes would have been made if the company was growing and healthy.
Let's say you're a late 90s company that rents servers to people (yes, Rackspace). There are lots of these companies, so to differentiate yourself, you hire some smart people to provide tech support and managed servers. You charge quite a bit of money (IIRC, they would charge like 400-500/mo for their cheapest server). Core technical ability is: managing data center costs/infrastructure and server administration (whatever is in RHEL certification). Companies love you, and give you lots of money.
You operate this way for the next decade. Then one day a company comes along and says, we'll let people rent servers hourly for a couple of dollars. No support. Some of your customers move a few workloads over, sales get a tiny bit harder... but your core customer base stays, because you sell fully managed servers and AWS doesn't. Your customers arent AWS customers, for the most part.
This is the foothold in the market that will eventually destroy your business... AWS will keep adding services, and eventually support contracts (which most people wont buy, meaning in general, AWS will be cheaper than rackspace). Each time AWS becomes more competitive, your position deteriorates slightly.
At some point, you recognize the threat, and decide to do something. You have two choices, which may be only one, depending on how much cash/resources you have available: 1) Start building features and services to duplicate your competitor. These will be expensive and becomes more difficult if the core competency of the two businesses isnt the same (like if you admin servers, and need to produce lots of software). This will burn through your capital and shorten your lifespan if it fails; and/or 2) You can control costs to ensure the business remains profitable. This will increase your life in the short term but ensure it fails in the long term.
The options that many lay people think of like decreasing prices, or increasing sales (somehow??) arent real options. A product has an entire structure behind it to deliver it, and just decreasing prices will not solve the competitive position, while increasing losses. So shortened life span, and no solution. Increasing sales isnt really an option, because if you could sell more you would... when customers have another option they prefer, selling to them becomes virtually impossible. If you run ads, for example, you'll see your metrics deteriorate, and this will limit your ad reach.
Now, rackspace did both of these things... they developed openstack... which was terrible (software from a non-software company, likely contributed to that)... and when that failed they went the cost control route.
My point is: No decision was made to put the company in this position... it's a position they found themselves in... and unless the leader can copy or innovate rapidly to save the company, or move the company into another segment... they'll find themselves in this poor position and likely eventually die. This bar is incredibly difficult to overcome: even if the founder was innovative, finding a new innovative product on short notice on demand while the source of funding for that declines.... most people will fail. This is why microsoft, facebook, google put an emphasis on innovating, even when they do not need to... easier to innovate when your position is strong, than in the final days of your core business.