Here's the Rule: Use compare to when likening one thing to another, compare with when describing differences. The number of copy editor hours spent on this distinction, aggregated over the past few decades, must be staggering. But was it time well spent?
My suspicion is that the compare to/compare with distinction may be another example of dog-whistle editing, observing distinctions drummed into copy editors' heads that virtually no reader, other than another copy editor, perceives. The imagined over/more than distinction and the fussy placement of only in sentences are further examples, though in the amount of work time wasted they are insignificant compared to the labor of recasting sentences to avoid the singular they.
Bryan Garner briefly summarizes the traditional distinction: "The usual phrase is compare with, which means "to place side by side, noting differences and similarities between." ... Compare to = to observe or point only to likenesses between. ..."
Merriam-Webster's Dictionary of English Usage devotes two and a half double-columned pages to the matter, discovery that the reality of usage is a good deal messier than the supposed rule, concluding from the evidence: "In 20th-century practice,the general rule of the handbooks is followed more often than not when compare is used as an active verb [in the compare to sense], but both with and to are used equally with the past participle. The rule can be looked upon as a guide that you may choose to observe if you wish to. Many writers obviously do not."
One of the most telling points in the examples MWDEU cites from reputable writers and publications, is that it is sometimes difficult or impossible to determine whether the writer is placing emphasis on similarity or difference. So I would suggest that copy editors are probably wasting their time changing the prepositions.
My concern here is not to dictate practice to writers, who will go along writing as they please. My concern is to relieve hard-pressed copy editors of the burden of enforcing ill-founded rules so that they can concentrate on legitimate issues of clarity and precision.