How could they have trained on books that they didn't buy or source from libraries?

I'm afraid, the companies in question, have been more than happy to ingest pirated material.