For an image/photography example, I may have my photo taken at an event and sign a release or agree to the event's T&Cs that say they can put publicity photos on their social media or website, but I don't intend that my photo will be used by an unrelated party to generate images of my face (this may not actually be restricted, yet, but I'd prefer it to be and I suspect few would consider it a reasonable outcome).
Copying books can be fair use if it is sufficiently transformative, copyright doesn't block all use of copyrighted material. A major case on this was around Google building a search index for books:
https://en.wikipedia.org/wiki/Authors_Guild,_Inc._v._Google,....
Open AI is currently attempting to argue that training a model is more transformative than building a search index, whether they win that argument or not is still to be seen.