I suspect kinda the latter, even though all legal literature on the subject claims that shareholders are the least important entities.
Somehow (neo-classical) economists have convinced the world that shareholder wealth are sacrosanct, and thus corporations will do all kinda of short term idiocies to boost share value and by extension shareholder wealth.