°To assess the similarities and differences between two or more things ["to compare X with Y"]. Having made the comparison of X with Y, one might have found it similarto Y or differentfrom Y.
°To declare two things to be similar in some respect ["to compare X to Y"].
"Astronomers have compared comets to dirty snowballs"