Yes it is a comparison. preferisco A a B (or: A piuttosto che B; A riespetto a B)
But the comparison could even be implicit sometimes (just like in english):
-"vuoi un caffè?" (would you like a coffee?)
-"grazie, preferisco un bicchiere di vino" (Thanks, I'd prefer a glass of wine)
So it's just like "to Prefer" in english, it always expresses a comparison, even if not specified in the sentence.