they are almost the same in many sentences.
example:My height is not that high compare to(compare with) him
But, there is a little different between them,I'd like to give some examples
1)Some poets compare sleep to death.(means sleep is like death)
2)The writer compares the moon to a small boat.(means moon is like boat)
in these situation,you cannot use compare with