Fiduciary duty is a real thing. Agent/principal relationships require the agent to try and get the maximum return for the level of risk.
Even if a CEO doesn’t have a written fiduciary duty in their contract do, the company as a whole usually does.
The CEO of a public corporation reports to the board who report to index fund managers who have a agent/principal relationships with all of their investors.