But this is what they characteristically fail at, or are given strong incentives not to do.
For example, one of the best things a stable, mature company can do is to just keep operating its business, making profits and returning the profits to the shareholders. Then the shareholders can use the money for whatever is most efficient, e.g. investing it in other companies with better growth potential. But the tax laws in the US punish that severely as compared with wasteful empire building or subsidiary shell games that warehouse cash in foreign subsidiaries in lower tax jurisdictions. Returning profits to shareholders gets taxed twice. Hoarding or wastefully/inefficiently spending the money doesn't get taxed at all. So they do the dumb stuff, and Apple holds onto a pile of cash the size of a mountain even though they're not actually doing anything productive with it.
You also have all kinds of problems with time frames. There are many things you can do to a company that will increase quarterly profits, like raising prices on customers that require a long lead time to switch to a competitor. Things like that may increase profits for years as the locked-in customers pay the price for as long as it takes them to transition to another vendor. But then the business starts to implode as the customers gradually all leave, and the same long lead time that kept them from quickly switching away (plus the damage you've done to your reputation) keeps them from quickly switching back. You can see this in, for example, Oracle's share of the database market slowly descending down a cliff.
And in general there are just information problems. Shareholders make decisions based on public information, but there is so much more involved in a company's operations than is described in those statements that it's easy for bad managers to waste or steal resources or otherwise make short-sighted decisions without ever getting held to account, and many incentives for them to do so, particularly when their current bonuses are tied to current-term numbers and not long-term numbers.