I ran into a super-annoying iCloud drive sync issue this weekend when setting up a new MacBook Pro. Not 100% sure how I got into the scenario but basically, the system ended up throwing a bunch of files on my desktop that I wanted to get rid of, and then when I deleted them, they'd just come right back a few minutes later!
The solution was to turn off iCloud drive sync, wait a few moments, then turn it back on. The files came back, but this time, the ones I wanted to get rid of stayed deleted when I removed them.
I suspect that the sync got, uh, out of sync due to iCloud not quite being done with the initial setup sync when I removed the files. So when it saw they were gone, it didn't realize it was intentional and kept trying to bring them back. In any case, super glad that this variation of "turn it off and back on again" really did clear up the problem :-)
I have been looking into scripts that record everything you may do on many websites and found what I consider to be the best answer to the problem. The ad blocker plugin AdBlock Plus (ABP) has been updated to block all the scripts that were found in the Princeton study of websites that run these scripts (see this page for a complete explanation).