It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "When Allah intends good for someone, He grants him understanding of the religion."
Hadith Referenceمسند احمد / ومن مسند بني هاشم / 2790