Yes, peer reviewers tend to work for free. Can you give an example of an editor who works for free? I asked in the parent comment, but nobody has provided any examples (although they have downvoted it, oddly). I'm not aware of any editors who work for free for top tier journals.
Prestige journals with paid editors are the rare exception. Academic journals typically have active researchers volunteering as editors, because the prestige of a journal largely comes from the people in the editorial board.
It depends on the journal, but we're talking here about the journals such as Nature and Elsevier which charge large fees, and those journals do indeed pay their editors.
Elsevier literally has thousands of journals. They charge large fees but that goes to Elsevier for essentially hosting a website and gatekeeping. Maybe some of the really big journals like Nature pay but not those like "Journal of Algebra" or "Journal of Cleaner Production".
I'm sure they have people employed called "editors" but they are not the same as academic editors who decide what gets sent to reviewers.
There are tiers of editors - including both administrative and academic editors. The latter are rarely paid.
For example, I'm on the editorial boards of three journals: Epidemiology, PLoS Computational Biology, and Infection Control & Hospital Epidemiology. I am compensated for none of them as an academic editor.