This is OK and fair use: Training LLMs on copyrighted work, since it's transformative.
This is not OK and not fair use: pirating data, or creating a big repository of pirated data that isn't necessarily for AI training.
Overall seems like a pretty reasonable ruling?
https://en.wikipedia.org/wiki/Authors_Guild,_Inc._v._Google,....
Maybe there's another big Google Books lawsuit that Google ultimately lost, but I don't know which one you mean in that case.