It's mostly people costs. There's also royalties to societies (the basic deal is academic societies own a lot of journals and license them to publishers for a royalty on sales). And there's tech/infrastructure costs for the systems to manage the manuscript workflow (and yes, for hosting the journal websites and serving PDFs). And even in this modern age some journals (most still maybe?) have some print component with costs. You can argue that's ridiculous (as I do) but parts of the academic library market is still in love with print for some reason.

But if you're trying to understand the real cost drivers it all comes back to the people involved. You're totally right in that peer reviewers are almost never paid (there are a few exceptions to this, like eLife). And often editorial boards of journals are not paid. Although there are also a significant amount of paid editors as well, either stipends provided to academics or in house editors. The internal staff manages the peer review process, which includes everything from finding reviewers to hounding reviewers to complete reviews, etc. That peer review management gets done by a combo of unpaid editors and paid editors.

So then there's society journals. More and more society journals have been scooped up by the major publishers, and the academic societies rely on the journal royalty to function. Now, you could argue (as I would) that academic societies should figure out ways to survive without journal subscription revenue royalties being an integral part of their finances (ie run conferences, purely via membership fees, etc) but the current reality is that a huge number of academic societies rely on the journal royalty to stay afloat.

Then there's marketing. A journal lives or dies by its reputation, and building a journal up requires a significant marketing effort to establish a journal to drive submissions. For new OA journals that marketing spend works very differently, and in fact requires a lot more spend on a consistent basis. OA journals live and die by steady submission flow (since the only revenue ever comes from accepted papers), and so you have to market the journal constantly to ensure you drive submissions.

There are also people employed that aren't direct costs to production but are responsible for new product ideas (R&D), and all the kinds of folks that are required to run a large organization, like HR, people in acquisitions trying to grow the business, people in sales, legal, etc etc.

I understand the visceral reaction against publishers. I have the same reaction to the subscription business model to be honest. My preference would be that the service publishers provide gets treated more like what it is - a service to academics who choose to use it - and gets charged accordingly. That's actually exactly what's happening with the move to Gold OA, where authors pay for the service of publishing. IMO that's actually working pretty well in STM, even though there's a long way to go. But unfortunately the non STM fields in the humanities and social sciences are having a lot of trouble in a transition like that. There are two main problems: in HSS there aren't tons of grants that academics can use to fund publication fees, and there's a huge, longstanding cultural assumption that publication should be free to academics, so it's hard to convince people that the publishing service should be bought (for any price). There are other people trying to solve this in different ways, like the Open Library of Humanities, but nothing has had significant success yet.

You can argue with profit levels (although I do think it's funny how much people are against profit in certain businesses and have no problem with profit in others, ie large tech cos). But what I object to is saying that publishers don't provide a valuable service. The use of terms like leech and rent-seeking imply a monopoly position and no value add whatsoever. First, nobody (even Elsevier) has a monopoly. There are 4-5 big publishers (Elsevier, Springer-Nature, Taylor & Francis, Wiley, SAGE) and then a huge number of smaller players (some of whom are substantial and highly influential, like Oxford University Press and Cambridge). So at best you can make the argument it's an oligopoly (although one that has about 2,000 total players).