In many cases great scholars are born into families of scholarship and receive a scholarly environment and upbringing that gives them an advantage and helps them to achieve higher proficiency and status. This is however not always the case and Allah Most High can grant deep understanding of faith to whomever He intends to bless with virtue.
It is related that the father of the great Bukharan Hanafi jurist of the mid fifth century CE, Shams al-A’imma ‘Abd al-‘Aziz ibn Ahmad al-Hulwani (may Allah have mercy on him), was a poor man who used to get buy in life by selling sweets (halwa). However, he would respect the jurists and present them with sweets from time to time requesting that they pray for his son.
Imam Zarnuji reports that through the baraka of this father’s generosity, his conviction, and his humility his son acquired what he did (Zarnuji, Ta’lim al-Mut’allim, p. 79). The imam came to be known by the title Shams al-A’imma, meaning the shining sun of scholars, due to his proficiency in jurisprudence.
The lessons to be learned from this are many: we must never consider any act of good to be insignificant, we must not underestimate the power of Allah to bestow something even if it seems against all odds, if we do not benefit directly someone from our decendents will benefit, and du’as (especially of the pious scholars) work.