Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:59:6

And what Allah restored ˹of property˺ to His Messenger from them - you did not spur for it ˹in an expedition˺ any horses or camels, but Allah gives His messengers power over whom He wills, and Allah is over all things competent.  

And whatever spoils God has given to His Messenger from these, you did not, O Muslims, spur for it any (min is extra) horses or camels, that is to say, you did not suffer any hardship in ˹securing˺ it, but God gives His messengers sway over whomever He will, and God has power over all things: hence you have no right to any of this ˹booty˺, rather it is exclusively for the Prophet (s) and those of the four categories mentioned with him in the next verse, ˹to be dispensed˺ in accordance with the way in which he used to divide it up, such that each would receive a fifth of the fifth and the rest being the Prophet’s (s), for him to do with as he pleases — thus he gave of it to the Emigrants and three from among the Helpers, on account of their poverty.
القرآن:٥٩:٦

وَمَا أَفَاءَ اللَّهُ عَلَىٰ رَسُولِهِ مِنْهُمْ فَمَا أَوْجَفْتُمْ عَلَيْهِ مِنْ خَيْلٍ وَلَا رِكَابٍ وَلَٰكِنَّ اللَّهَ يُسَلِّطُ رُسُلَهُ عَلَىٰ مَنْ يَشَاءُ ۚ وَاللَّهُ عَلَىٰ كُلِّ شَيْءٍ قَدِيرٌ  

{وما أفاء} رد {الله على رسوله منهم فما أوجفتم} أسرعتم يا مسلمون {عليه من} زائدة {خيل ولا ركاب} إبل، أي لم تقاسوا فيه مشقة {ولكن الله يسلط رسله على من يشاء والله على كل شيءٍ قدير} فلا حق لكم فيه ويختص به النبي ﷺ ومن ذكر معه في الآية الثانية من الأصناف الأربعة على ما كان يقسمه من أن لكل منهم خمس الخمس وله ﷺ الباقي يفعل فيه ما يشاء فأعطى منه المهاجرين وثلاثة من الأنصار لفقرهم.