Because of a common quality of two different things, one is compared with the other, it is called similie.
For example:
वागर्थाविव संपृक्तौ वागर्थप्रतिपत्तये।
जगतः पितरौ वन्दे पार्वतीपरमेश्वरौ ।।
(For aquisition of knowledge of words and meaning, I bow down to the parents of the world - Uma and Mahesha, who are united like words and meaning.)
Here two different objects वागर्थों (word and meaning) and पार्वती-परमेश्वरौ (Parvati and Parameshwara) have common quality संपृक्त (be together) so पार्वती-परमेश्वरौ is compared with वागर्थो hence, the figure of speech is similie.
(Note: There are 4 parts of similie (1) the उपमेय the object which is to be compared. (2) उपमान i.e. the object with which उपमेय is compared. (3) उपमावाचक शब्द i.e. the word indicating comparison for e.g. इव, सम, सदृश, तुल्य etc. (All these words mean like it) (4) साधारण धर्म i.e, the common quality or pecularity of उपमान and उपमेय. In the above stated illustration उपमेय is पार्वती परमेश्वर, उपमान is वागर्थ, उपमावाचक is इव while साधारण धर्म is संवृत्त (to live toghether).