Legitimate peer-reviewed journals, including the increasing number of online open access journals, charge authors an article processing fee. These charges, which can easily be upwards of £1,500 a go, are used to pay for the production costs of the journal.
It may be worth noting that this is not true in all disciplines. Publication fees are quite rare in the humanities. Authors aren't compensated, of course, and neither, generally, are reviewers or sub-editors. Senior editors might get compensated with a course release and a part-time assistant (an undergraduate intern or a graduate-student research assistant - these are vehicles for student financial aid, in other words). Humanities journals are typically funded through subscriptions and a modicum of advertising, and sometimes institutional support.
That business model has its own problems, of course. Unpaid reviewers and sub-editors rarely feel the need to be terribly prompt about responding to submissions, for example.