Both the common Spanish comprar (“to buy”) and the similar-sounding-but-different-meaning compare in English come from the same Latin root: comparare, meaning “to make equal with; bring together for a contest.”
How could one word evolve into two very separate meanings? Well, the original Latin comparare comes from the root com (“with”) + parare (“prepare”); what do you do with a pair of things other than prepare to make a choice between them by comparing them to find similarities and differences — these either turn into a conflict between them, or become the same… or both?
So, the English compare preserves the original sense, although with less rivalry within the pair. But the Spanish basically tells us that shopping is just an exercise in comparative shopping — comparative, literally! Just comparing existing products and choosing the best.
And it’s noteworthy that the Spanish comprar implies much more preparation than the English does. Those Spanish are careful shoppers!
So he who buys without comparing it to the other alternatives really isn’t buying (or at least, comprar-ing), in the original sense.