I read the book
"Reinventing Organizations" by Laloux a few years ago and I can't recommend it highly enough for a non-cynical take on how to create healthy organizations.
The first few chapters talk through the history of human organization, from dominance-based tribes ("I'm the biggest man so do what I say"), through to modern corporations, with nominally-meritocratic hierarchy of management. And organizations where "we're all equal". He doesn't hold his punches when talking about the downsides of these organizational approaches.
Then the rest of the book does a deep dive on a lot of organizational approaches that are being tried out in different organizations around the world, to talk aspirationally about what he thinks comes next in how humans coordinate.
I think his answers to your two questions would be something like:
> 1. Principal-agent problem. Who do the employees work for? Self interest.
No, this sounds circular but the employees work for each other (and your customers). Healthy teams care about each other as people, and if they can form emotional connections with your users they'll care far more about making them happy than they will about ever care about the annual budget. Its a cultural thing - but it can be supported by process. Set up a lot of conversations between the developers and the clients. A manufacturing company started sitting sales people with the line operators. If the sales person didn't sell enough parts for the team, there physically wasn't work for the operators that they're working with.
> 2. Failure mode. ... This is why I doubt that management can be automated.
Yeah, hard agree on that. So don't try to automate management! The job of management in healthy companies in Laloux's book is to support the actual work being done on the ground, mediate conflict, provide advice when asked and set up conversations between people. The people doing the actual work will always have more concrete information about whats happening in a day-to-day way than management will. So let engineers make and own decisions.
In the book they talk about the Advice Process, where basically anyone in the company can initiate any change - so long as they consult with people the change will affect and take feedback before doing it. (The bigger the change, the more feedback). Management processes need to be things people who aren't management (but are affected by the processes) actually want.
I think we (obviously) need to experiment more with this stuff more in the startup / tech space. Traditional management structures are nowhere near the ideal form of how we make companies.