We actually have detailed data on how authors cover the costs of open access publishing from over 1,000 respondents who submitted a paper to a JMIR journal and filled in the post-submission author survey. The following shows the results as of April 2017:

Most authors (44.8%) pay these costs from their grant money, from the same line item in a grant from which they would for example pay conference travel and fees. Some other authors have some grants or institutional funding for educational activities or conferences (20.9%). Some universities, institutions or departments have institutional membership arrangements with JMIR Publications, in which case the APF can be waived (14.5%). Other institutions may have institutional open access funds, for example the signatories of the Compact for Open Access Equity (13.3%). Some others have slush or reserve funds (8.7%) or take the money from somewhere else (9.4%).