Multiple books are created at high but not too high prices. Stolen funds are used to buy them; (through multiple intermediaries, work from home mules being a favorite) and the profits are moved through multiple accounts as well.
The criminals don't care that they are giving a bunch of money to Amazon (it's stolen remember), they do want the funds coming out to be clean, untraceable, and usable.
The unfortunate thing being that Amazon's incentives are, in this case, aligned with those of the criminals. And while I'm sure that Amazon regularly helps law enforcement track down this sort of thing, I wouldn't doubt that there exists a temptation to not notice that sort of misbehaviour.