Open access (OA) journals perform peer review and then make the approved contents freely available to the world. Their expenses consist of peer review, manuscript preparation, and server space.
"Open" refers to journals being online, free of charge to read and access, and licensed so that others can share and use the work free of charge, too. Attribution to authors is always expected; in fact, open licenses require attribution of a work to the original authors.
OA journals pay their bills very much the way broadcast television and radio stations do: those with an interest in disseminating the content pay the production costs upfront so that access can be free of charge for everyone with the right equipment.
OA journals that charge processing fees usually waive them in cases of economic hardship. OA journals with institutional subsidies tend to charge no processing fees.