A simile does not require the compared terms to share every attribute.

ʿIlm al-Bayān and the Foundations of Tashbīh: Signification, Terms and Resemblance