Abraham was gifted with spiritual understanding from an early age. Allah enlightened his heart and mind and gave him wisdom from childhood. Allah the Almighty stated: And indeed We bestowed aforetime on Abraham his (portion of) guidance, and We were Well-Acquainted with him (as to his Belief in the Oneness of Allah, etc.). Surah 21: 51