* the purpose and character of the use
* the nature of the copyrighted work;
* the amount and substantiality of the portion used in relation to the copyrighted work as a whole
* the effect of the use upon the potential market for or value of the copyrighted work.
In the Internet Archive case, they're distributing whole, unmodified copies of copyrighted works which will of course compete with those original works.In the AI use case, they're typically aiming not to output any significant part of the training data. So they could well argue that the use is transformative, reproducing only minimal parts of the original work and not competing in the market with the original work.