It has been narrated on the authority of Abu Huraira that the Messenger of Allah (ﷺ) said
If you come to a township (which has surrendered without a formal war) and stay therein, you have a share (that will be in the form of an award) in (the properties obtained from) it. If a township disobeys Allah and His Messenger (and actually fights against the Muslims) one-fifth of the booty seized therefrom is for Allah and His Apostle and the rest is for you.
It has been narrated on the authority of Umar, who said
The properties abandoned by Banu Nadir were the ones which Allah bestowed upon His Apostle for which no expedition was undertaken either with cavalry or camelry. These properties were particularly meant for the Prophet (ﷺ). He would meet the annual expenditure of his family from the income thereof, and would spend what remained for purchasing horses and weapons as preparation for Jihad.
This hadith has been narrated on the authority of Zuhri.
It is reported by Zuhri that this tradition was narrated to him by Malik b. Aus who said
Umar b. al-Khattab sent for me and I came to him when the day had advanced. I found him in his house sitting on his bare bed-stead, reclining on a leather pillow. He said (to me): Malik, some people of your tribe have hastened to me (with a request for help). I have ordered a little money for them. Take it and distribute it among them. I said: I wish you had ordered somebody else to do this job. He said: Malik, take it (and do what you have been told). At this moment (his man-servant) Yarfa' came in and said: Commander of the Faithful, what do you say about Uthman, Abd al-Rabman b. 'Auf, Zubair and Sa'd (who have come to seek an audience with you)? He said: Yes, and permitted them. so they entered. Then he (Yarfa') came again and said: What do you say about 'Ali and Abbas (who are present at the door)? He said: Yes, and permitted them to enter. Abbas said: Commander of the Faithful, decide (the dispute) between me and this sinful, treacherous, dishonest liar. The people (who were present) also said: Yes. Commander of the Faithful, do decide (the dispute) and have mercy on them. Malik b. Aus said: I could well imagine that they had sent them in advance for this purpose (by 'Ali and Abbas). 'Umar said: Wait and be patient. I adjure you by Allah by Whose order the heavens and the earth are sustained, don't you know that the Messenger of Allah (ﷺ) said:" We (prophets) do not have any heirs; what we leave behind is (to be given in) charity"? They said: Yes. Then he turned to Abbas and 'Ali and said: I adjure you both by Allah by Whose order the heavens and earth are sustained, don't you know that the Messenger of Allah (ﷺ) said:" We do not have any heirs; what we leave behind is (to be given in) charity"? They (too) said: Yes. (Then) Umar said: Allah, the Glorious and Exalted, had done to His Messenger (ﷺ) a special favour that He has not done to anyone else except him. He quoted the Qur'anic verse:" What Allah has bestowed upon His Apostle from (the properties) of the people of township is for Allah and His Messenger". The narrator said: I do not know whether he also recited the previous verse or not. Umar continued: The Messenger of Allah (ﷺ) distrbuted among you the properties abandoned by Banu Nadir. By Allah, he never preferred himself over you and never appropriated anything to your exclusion. (After a fair distribution in this way) this property was left over. The Messenger of Allah (ﷺ) would meet from its income his annual expenditure, and what remained would be deposited in the Bait-ul-Mal. (Continuing further) he said: I adjure you by Allah by Whose order the heavens and the earth are sustained. Do you know this? They said: Yes. Then he adjured Abbas and 'All as he had adjured the other persons and asked: Do you both know this? They said: Yes. He said: When the Messenger of Allah (ﷺ) passed away, Abu Bakr said:" I am the successor of the Messenger of Allah (ﷺ)." Both of you came to demand your shares from the property (left behind by the Messenger of Allah). (Referring to Hadrat 'Abbas), he said: You demanded your share from the property of your nephew, and he (referring to 'Ali) demanded a share on behalf of his wife from the property of her father. Abu Bakr (Allah be pleased with him) said: The Messenger of Allah (ﷺ) had said:" We do not have any heirs; what we leave behind is (to be given in) charity." So both of you thought him to be a liar, sinful, treacherous and dishonest. And Allah knows that he was true, virtuous, well-guided and a follower of truth. When Abu Bakr passed away and (I have become) the successor of the Messenger of Allah (ﷺ) and Abu Bakr (Allah be pleased with him), you thought me to be a liar, sinful, treacherous and dishonest. And Allah knows that I am true, virtuous, well-guided and a follower of truth. I became the guardian of this property. Then you as well as he came to me. Both of you have come and your purpose is identical. You said: Entrust the property to us. I said: If you wish that I should entrust it to you, it will be on the condition that both of you will undertake to abide by a pledge made with Allah that you will use it in the same way as the Messenger of Allah (ﷺ) used it. So both of you got it. He said: Wasn't it like this? They said: Yes. He said: Then you have (again) come to me with the request that I should adjudge between you. No, by Allah. I will not give any other judgment except this until the arrival of the Doomsday. If you are unable to hold the property on this condition, return it to me.
The same hadith has been narrated by a different chain of transmitters with a slight variation in wording
'Umar b. al-Khattab sent for me and said: Some families from your tribe have come to me (then follows the foregoing hadith) by Malik with the difference that the Messenger of Allah (ﷺ) would spend on his family for a year. And sometimes Ma'mar said: He would retain sustenance for his family for a year, and what was left of that he spent in the cause of Allah, the Majestic and Exalted.