When you are stressing the similarities of two different things, use “compared to.” You can usually substitute “likened to” for “compared to.”
A vertical well can be compared to a straw in a very tall glass of soda pop.
Buying an oilfield from another company can be compared to buying a used car: the seller is going to emphasize the positives while concealing the negatives.
If you are comparing both the similarities and the differences between two similar things, use “compared with.”
Please ask her to compare Version B with Version D of this control valve specification.
The wireline formation tester’s “mini-DST” results were compared with conventional well testing using drillstem test results.
Nothing compares with Nanny’s home cooking, especially her butter beans and corn bread!