The prophets (AS) had the highest level of Iman, so they were put through the harshest of tests. The most difficult tests in this world came to the prophets (AS). Sometimes they would be physical, in the form of torture or punishment; falling sick, being poisoned, and sometimes it would be from emotions or being hurt from people, sometimes being hurt from those closest to them, like their wives, children, blood relatives or tribes. After the prophets (AS), the highest status belongs to the sahaba of the prophet (SAW). They were also put through extremely difficult tests. In one battle, the battle of Hunayn which took place after the conquest of Makkah, the battle itself was a test because the Muslims went in overconfident due to their numbers, and for the first time, it looked like they were going to outnumber their enemy. They said, “There is no way we can lose because of smaller numbers.” Very early in the battle, Allah (SWT) showed them that their numbers were not going to give them victory. Then, the prophet (SAW) called the ansar, the people of Madinah, close to him, and the people who took the Bay’ah, the oath of allegiance under the tree, rushed to the prophet (SAW), and he moved forward with them, changing the flow of the battle. Ultimately, they won. This battle perhaps brought them the greatest amount of war spoils (meaning wealth that is conquered and taken after a battle) more than any other battle. The reason for this was that the chief of the people of Hunayn told his people to bring everything they had, including thousands of camels, goats and sheep into the battlefield to remind them what would happen if they were to lose the battle. They also brought all of their family members and their wealth of gold and silver. This was a huge tribe.
So, when the Muslims won, all of this came into their hands, so there was an enormous amount of wealth to be distributed. Now, as I mentioned, this happened right after the conquest of Makkah, and at the conquest of Makkah, just before, during and shortly after, everyone of Quraysh had accepted Islam. Everyone who had been fighting against the prophet (SAW) all of these years had finally accepted Islam. People like Abu Sufiyan, for example, who had waged war against the Muslims multiple times, became Muslim; his son, Mu’awiya became Muslim, Ikrima, the son of Abu Jahl became Muslim, and Hind, the wife of Abu Sufiyan became Muslim. These were all very staunch enemies. There was a huge number of recent converts in the religion, and they were so new that they did not know much about Islam and were still very shaky. They had also lost many battles against the Muslims, in that they had lost their wealth, their children (in the sense that they had lost their fathers) and so the prophet (SAW) used almost all of this wealth to give to the new Muslims.