Think of it as the Big Data hype some years ago.
What they have been doing, with some narrow exceptions where they have lost billions of dollars in court cases*, is not at all obviously prohibited by copyright law. Neither web scraping (i.e. asking for copies of data from people you have every reason to believe are authorized to give you copies) or running algorithms on copyrighted data are generally copyright infringment. I say generally because the "algorithm" of "ctrl-c ctrl-v" is obviously an exception, and there's some argument that training is similar enough to be illegal - a fairly weak argument that is mostly losing in court but has some tiny chance of still succeeding.
The law doesn't have teeth to prohibit things not prohibited under the law - no matter how much many people would like them to be prohibited. This shouldn't be surprising.
Unlike with copyright, the law does pretty clearly prohibit violating contractual terms to not hang onto or use other peoples data for purposes other than the narrow ones laid out in the contract when you agreed to the contract.
* Namely acquiring copies of data from people who they know aren't authorized to make copies - i.e. torrenting.
So they are in fact literally reselling copyrighted data.
More problematically there are camouflaged sharp spines pointed primarily in the direction of poorer people, and people not advised by lawyers.
But none of that matters here when the damaged parties include the megacorps of the world.