Q. CMOS 5.195 says that “compare with” is for literal comparisons and “compare to” for poetic or metaphorical comparisons. What is a “literal comparison,” and how does it compare with a “poetic or metaphorical comparison”?
A. A literal comparison examines two things relative to each other in a process that might turn up both similarities and differences (but often with an emphasis on the differences); you’ve demonstrated this usage in your question (“how does it compare with . . . ?”). We might also, for example, compare The Chicago Manual of Style with the AP Stylebook.
In a poetic or metaphorical comparison, the point is to note similarities between things that are not necessarily similar—as in Shakespeare’s “Shall I compare thee to a summer’s day?” People and summer days aren’t literally alike; figuratively, however, it’s a different story (e.g., they might both be “lovely” or “temperate”). This type of comparison—with “to” rather than “with”—is useful for suggesting similarities of any kind: “Please don’t compare me to him. We’re not at all the same.”
For what it’s worth, the “to/with” distinction seems to be fading, as this Google Ngram comparing the frequency of “compared with” with that of “compared to” in books published in English since 1800 suggests (showing “to” overtaking “with” in the mid-1980s—a reversal that happened in the mid-1970s in American English but thirty years later in British English):
Adjusting the terms to “compare to” vs. “compare with” or “compare this to” vs. “compare this with” (and the like) shows a similar trend. If you’re a copyeditor, you might choose to enforce the distinction in formal prose but not necessarily in fictional dialogue and the like.