The parable of the grain
Allah says: "The example of those who spend their wealth in the way of Allah is like a seed of grain which grows seven spikes; in each spike is a hundred grains. And Allah multiplies for whom He wills. And Allah is all-Encompassing and Knowing" (Quran 2:261). Spending "in the way of Allah" covers every good cause: helping the poor and relatives, supporting orphans, feeding people, building what benefits the community and supporting knowledge.
The Prophet ﷺ gave a picture of how a small gift grows. He said that whoever gives in charity the equivalent of a date from pure earnings, Allah accepts it in His right hand and then raises it for the giver as one of you raises a young animal, until it becomes like a mountain or greater (Sahih al-Bukhari 1410; Sahih Muslim 1014). Allah accepts only what is good, so the earnings must be lawful.



