You can get a little discombobulated reading the comments from the nerds / subject idiots on this site.
No piracy or even AI was required, here. Google's defense was that their product couldn't reproduce the book in it's entirety, which was proven and made the prosecution about Fair Use instead. Given that it was much harder to prosecute on those grounds, Google tried coercing the authors into a settlement before eventually the District Court dropped the case in Google's favor altogether.
OpenAI's lawyers are aware of the precedent on copyright law. They're going to argue their application is Fair Use, and they might get away with it.
Mind you, Google books, literally just text from copyrighted books published for everyone online, was ruled "fair use", due to it's benefit to humanity.