Article Processing Charges or APC, are usually required to be paid by the author. This could be covered in various ways. One way that APC could be covered could be by research grants.
Another way is that for University of Toronto researchers, University of Toronto either fully funds or offers discounts on APC:
University of Toronto is also a member of the Canadian Research Knowledge Network which also offers discounts on APC:
Some journals does not require the author to pay but are rather funded by other means. Some of these means are donations and grants. Another way is memberships fees, for example a journal is published by an association, and members of the association has to pay a membership fee, part of which covers the cost of the journal.
Another way that journals are funded is advertising. Be warned of potential conflict of interest. For example, an article advising a certain medication as treatment contains advertisement for that medication.