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 similar to Y or different from Y.
Compare the tiger's coloration with that of the zebra.
You can't compare my problems and yours.
To declare two things to be similar in some respect ["to compare X to Y"].
Astronomers have compared comets to dirty snowballs.
To form the three degrees of comparison of (an adjective).