Semi-learned borrowing from Latin comparāre (“compare, match, place together, couple”). Doublet of comprar.
Practice speaking and memorizing "comparar" and many other words and sentences in Portuguese.