When compare involves activities that describe similarities between different things, compare usually uses prepositions to:
He compared her to summer.
He compared her to summer.
Scientists sometimes compare the human brain to a computer.
Scientists sometimes compare the human brain to a computer.