Reason of revelation:
Prophet Muhammad (saws) once went to perform the Umra of Al-Qadaa and was accompanied by Asmaa Bint Abi Bakr. Asmaa’s mother and grandmother, who were still disbelievers, asking for money. She, then, refuse to give them till she asks Prophet Muhammad (saws) to do so as they both were non-Muslim. She asked to be permitted by the Prophet; then, this verse was revealed. After that, the Prophet (saws) permitted her, and she gave them. Another story about the reason of revelation was told by ‘Al-Kalbi.’ It says that some Muslims had Jewish relatives and in-laws to whom they used to had given charities prior to their conversion to Islam. So, didn’t like to do that after they had converted to Islam but sought the permission of Prophet Muhammad (saws). Subsequently, this verse was revealed and they gave them. In this context, spending is not about giving away to Muslims only, and all people are created by the Almighty. Thus, you can give charities to Muslims and non-Muslims, if in need. And this verse, which is among the verses on spending in the way of Allah (swt), is a proof of the same.
(… لَّيْسَ عَلَيْكَ هُدَاهُمْ وَلَٰكِنَّ اللَّهَ يَهْدِي مَن يَشَاءُ ) (Not upon you, [O Muhammad], is [responsibility for] their guidance, but Allah guides whom He wills …): The Almighty elaborate on guidance when He has told Prophet Muhammad (saws):
{إِنَّكَ لَا تَهْدِي مَنْ أَحْبَبْتَ وَلَٰكِنَّ اللَّهَ يَهْدِي مَن يَشَاءُ}
(Indeed, [O Muhammad], you do not guide whom you like, but Allah guides whom He wills.) (Al-Qasas: 56)
{ وَإِنَّكَ لَتَهْدِي إِلَىٰ صِرَاطٍ مُّسْتَقِيمٍ}
(And indeed, [O Muhammad], you guide to a straight path.) (Ash-Shura: 52)
Such guidance is about guiding to the good and Allah’s Sharia. You guide people but can never make them follow by heart and soul, a thing that only Allah (swt) can do. Consequently, we can’t compel people to follow Allah’s Sharia as the Almighty says: (Not upon you, [O Muhammad], is [responsibility for] their guidance, but Allah guides whom He wills.) and
{فَذَكِّرْ إِنَّمَا أَنتَ مُذَكِّرٌ * لَّسْتَ عَلَيْهِم بِمُصَيْطِر}
(So remind, [O Muhammad]; you are only a reminder. % You are not over them a controller.) (Al-Ghaashiya: 21-22)
(… وَمَا تُنفِقُوا مِنْ خَيْرٍ …) (…And whatever good you [believers] spend …): The Almighty names the process of spending (money or power) in the way of Allah (swt) and other people as ‘good.’ That’s why Islam can’t be by a religion of mercy. We start everything we do by Basmala (in the name of Allah, the Compassionate, the Merciful). In addition, Allah (swt) tells Prophet Muhammad (saws):
{وَمَا أَرْسَلْنَاكَ إِلَّا رَحْمَةً لِّلْعَالَمِينَ}
(And We have not sent you, [O Muhammad], except as a mercy to the worlds.) (Al-Anbiyaa: 107)
Not only to Muslims. So, whatever good that you spend is meant to all people regardless of their races, belonging, religions, or faiths because they are among Allah’s creatures. In short, you have to do good to others regardless on their belonging.
(… فَلِأَنفُسِكُمْ …) (…is for yourselves …): Whatever good one does pays off. Allah (swt) says:
{وَمَا تُقَدِّمُوا لِأَنفُسِكُم مِّنْ خَيْرٍ تَجِدُوهُ عِندَ اللَّهِ هُوَ خَيْرًا وَأَعْظَمَ أَجْرًا ۚ}
(And whatever good you put forward for yourselves – you will find it with Allah. It is better and greater in reward.) (Al-Muzzammil: 20)
Thus, it’s not ‘good’ only; you put forward for yourself when you give away to the poor, keeping the Lord in mind. One of the pious people used to weep after giving away to the poor; and when asked about the reason, he used to say: ‘I’ve kept someone coming with the good for me (waiting) at my gate.’ This means that a poor person (to whom you give away) brings the good for yourself. An important point to highlight here is that spending by virtue of Zakat is a religious obligation for the rich, not the poor, who have no such obligation. Spending, i.e. Zakat in this context, is one of the five pillars of Islam, which can’t be without Zakat. The rich, then, need the poor; the question here can be: who is more in need of the other: the poor (in terms of money) or the rich (in terms of religion)? The rich, indeed, because this is a matter of faith, the pillars of Islam. The rich need to fulfill the pillars of Islam by giving away to the poor, whereas the poor take only because they need money and not to fulfill a religious duty.
(… وَمَا تُنفِقُونَ إِلَّا ابْتِغَاءَ وَجْهِ اللَّهِ …) (…and you do not spend except seeking the countenance of Allah …): You get rewarded only by the one for whom you’ve worked. That’s why spending has to be in the way of Allah (swt) because it goes along with people when it’s for their sake.
(… وَمَا تُنفِقُوا مِنْ خَيْرٍ يُوَفَّ إِلَيْكُمْ …) (…And whatever you spend of good – it will be fully repaid to you …): It’s repaid in full.
( وَأَنتُمْ لَا تُظْلَمُونَ … ) (…and you will not be wronged): You’re not wronged in this life since you spend and, thus, avoid the hatred of the poor. Moreover, you’re not wronged in the afterlife as you’ve obeyed Allah’s orders and protected your money by Zakat.