One term can be sensory and the other intellectual. The analogy then moves between domains of experience to make the intended feature accessible.
In “His character is like perfume,” character is an intangible quality and perfume is perceptible through smell. They differ in kind, but their pleasant effect and benefit to others may serve as the intended comparison.