One can obtain reference materials from various sources. If not of open access, it could be either bought from a publisher or downloaded with an institutional license or even borrowed from a colleague.
Just out of curiosity, was there ever a situation where authors must prove their access to the articles cited in their paper to the editor/publisher/reviewer?
I agree that some of the references need not necessarily require licenced access for the sake of referencing such as pointing to datasets. However, my concern is about original research articles from which you cite a piece of information in your paper.