The Prophet ﷺ said, "When Allah intends good for a servant, He grants him understanding of the religion."
حدثنا روح قال حدثنا حماد بن سلمة عن جبلة بن عطية عن ابن محيريز
عن النبي ﷺ قال إذا أراد الله عز وجل بعبد خيرا يفقه في الدين
Its isnad is sahih, mentioned previously at 16803.