It is narrated from the sixth Shia Imam, Ja’afar Al-Sadeq (AS) who said:
The miracle is a Divine Sign that Allah (SWT) does not grant to anyone except to God’s prophets (Peace Be on All of Them), messengers (AS) and Imams (AS) (and all the infallibles (AS)). And the aim of the miracle is to differentiate the truthfulness of the honest one from the lying of the liar [1].
[1] Beharul Anwaar, Vol. 12, Page 77.
Source: en.shafaqna.com